MCPcopy Create free account
hub / github.com/davidgiven/fluxengine / adfVolumeInfo

Function adfVolumeInfo

dep/adflib/src/adf_disk.c:95–151  ·  view source on GitHub ↗

* adfVolumeInfo * */

Source from the content-addressed store, hash-verified

93 *
94 */
95void adfVolumeInfo(struct Volume *vol)
96{
97 struct bRootBlock root;
98 char diskName[35];
99 int days,month,year;
100
101 if (adfReadRootBlock(vol, vol->rootBlock, &root)!=RC_OK)
102 return;
103
104 memset(diskName, 0, 35);
105 memcpy(diskName, root.diskName, root.nameLen);
106
107 printf ("Name : %-30s\n",vol->volName);
108 printf ("Type : ");
109 switch(vol->dev->devType) {
110 case DEVTYPE_FLOPDD:
111 printf ("Floppy Double Density : 880 KBytes\n");
112 break;
113 case DEVTYPE_FLOPHD:
114 printf ("Floppy High Density : 1760 KBytes\n");
115 break;
116 case DEVTYPE_HARDDISK:
117 printf ("Hard Disk partition : %3.1f KBytes\n",
118 (vol->lastBlock - vol->firstBlock +1) * 512.0/1024.0);
119 break;
120 case DEVTYPE_HARDFILE:
121 printf ("HardFile : %3.1f KBytes\n",
122 (vol->lastBlock - vol->firstBlock +1) * 512.0/1024.0);
123 break;
124 default:
125 printf ("Unknown devType!\n");
126 }
127 printf ("Filesystem : ");
128 printf("%s ",isFFS(vol->dosType) ? "FFS" : "OFS");
129 if (isINTL(vol->dosType))
130 printf ("INTL ");
131 if (isDIRCACHE(vol->dosType))
132 printf ("DIRCACHE ");
133 putchar('\n');
134
135 printf("Free blocks = %d\n", adfCountFreeBlocks(vol));
136 if (vol->readOnly)
137 printf("Read only\n");
138 else
139 printf("Read/Write\n");
140
141 /* created */
142 adfDays2Date(root.coDays, &year, &month, &days);
143 printf ("created %d/%02d/%02d %d:%02d:%02d\n",days,month,year,
144 root.coMins/60,root.coMins%60,root.coTicks/50);
145 adfDays2Date(root.days, &year, &month, &days);
146 printf ("last access %d/%02d/%02d %d:%02d:%02d, ",days,month,year,
147 root.mins/60,root.mins%60,root.ticks/50);
148 adfDays2Date(root.cDays, &year, &month, &days);
149 printf ("%d/%02d/%02d %d:%02d:%02d\n",days,month,year,
150 root.cMins/60,root.cMins%60,root.cTicks/50);
151}
152

Callers

nothing calls this directly

Calls 3

adfReadRootBlockFunction · 0.85
adfCountFreeBlocksFunction · 0.85
adfDays2DateFunction · 0.85

Tested by

no test coverage detected