MCPcopy Create free account
hub / github.com/NetHack/NetHack / freediskspace

Function freediskspace

sys/windows/windsys.c:125–141  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

123}
124
125long
126freediskspace(char *path)
127{
128 char tmppath[4];
129 DWORD SectorsPerCluster = 0;
130 DWORD BytesPerSector = 0;
131 DWORD FreeClusters = 0;
132 DWORD TotalClusters = 0;
133
134 tmppath[0] = *path;
135 tmppath[1] = ':';
136 tmppath[2] = '\\';
137 tmppath[3] = '\0';
138 GetDiskFreeSpace(tmppath, &SectorsPerCluster, &BytesPerSector,
139 &FreeClusters, &TotalClusters);
140 return (long) (SectorsPerCluster * BytesPerSector * FreeClusters);
141}
142
143/*
144 * Functions to get filenames using wildcards

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected