0

Hello there, do you have any idea what is the corresponding function of this Win32 api (GetDiskFreeSpace) in standard library?

Thanks. :)

2
Contributors
4
Replies
5
Views
9 Years
Discussion Span
Last Post by jaepi
0

There isn't one.

GetDiskFreeSpace() is an OS-specific function. If you are looking to find free disk space in linux, google statfs(). That's not a standard function anywhere, but it is a common extension to System V. It obsoletes ustat(), which also does the job.

Hope this helps.

0

I think I might use the statvfs function. I'm kind of confused with the parameters passed in GetDiskFreeSpace (specially the ones that receives the output).

0

Uhmm, what do you think is the one that corresponds to the lpBytesPerSector parameter of the GetDiskFreeSpace "BOOL WINAPI GetDiskFreeSpace(LPCTSTR lpRootPathName, LPDWORD lpSectorsPerCluster, LPDWORD lpBytesPerSector, LPDWORD lpNumberOfFreeClusters, LPDWORD lpTotalNumberOfClusters);"

function to the members of the struct statvfs

"unsigned long f_bsize;
unsigned long f_frsize;
fsblkcnt_t f_blocks;
fsblkcnt_t f_bfree;
fsblkcnt_t f_bavail;
fsfilcnt_t f_files;
fsfilcnt_t f_ffree;
fsfilcnt_t f_favail;
unsigned long f_fsid;
unsigned long f_flag;
unsigned long f_namemax;
unsigned long f_type;
char f_basetype[FSTYPSZ];
char f_str[FSSTRSZ];" ?

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.