I dont know...
-
Sorry about this, does anyone know what the following code does
DWORD Thing::GetDiviceFreeSpace(LPCTSTR lpszPath) { struct statfs sStats; if(statfs(lpszPath,&sStats)== -1) return 0; return sStats.f_bsize * sStats.f_bavail; }
I found it in some project I am working on, confusing --- Why are all the good signitures taken already?:rolleyes: -
Sorry about this, does anyone know what the following code does
DWORD Thing::GetDiviceFreeSpace(LPCTSTR lpszPath) { struct statfs sStats; if(statfs(lpszPath,&sStats)== -1) return 0; return sStats.f_bsize * sStats.f_bavail; }
I found it in some project I am working on, confusing --- Why are all the good signitures taken already?:rolleyes:Coremn wrote: Sorry about this, does anyone know what the following code does
DWORD Thing::GetDiviceFreeSpace(LPCTSTR lpszPath)
may very well get a devices free space.statfs()
sounds very much like "STATatus of FileSystem", so this would also fit in. Third, a search in MSDN showedstatfs()
to be a "NFS Version 2 RPC Call", the description being 'Get file system attributes'. Hope this helped PS. I charge you 30 Dollar for information retrieval service. ;P -
Sorry about this, does anyone know what the following code does
DWORD Thing::GetDiviceFreeSpace(LPCTSTR lpszPath) { struct statfs sStats; if(statfs(lpszPath,&sStats)== -1) return 0; return sStats.f_bsize * sStats.f_bavail; }
I found it in some project I am working on, confusing --- Why are all the good signitures taken already?:rolleyes:You need to know what the struct is in order to know what it does. the statfs struct must be defined somewhere else for this to do anything. Search MSDN, if it's not there, search your code. Christian Hey, at least Logo had, at it's inception, a mechanical turtle. VB has always lacked even that... - Shog9 04-09-2002 Cats, and most other animals apart from mad cows can write fully functional vb code. - Simon Walton - 6-Aug-2002
-
Coremn wrote: Sorry about this, does anyone know what the following code does
DWORD Thing::GetDiviceFreeSpace(LPCTSTR lpszPath)
may very well get a devices free space.statfs()
sounds very much like "STATatus of FileSystem", so this would also fit in. Third, a search in MSDN showedstatfs()
to be a "NFS Version 2 RPC Call", the description being 'Get file system attributes'. Hope this helped PS. I charge you 30 Dollar for information retrieval service. ;P -
You need to know what the struct is in order to know what it does. the statfs struct must be defined somewhere else for this to do anything. Search MSDN, if it's not there, search your code. Christian Hey, at least Logo had, at it's inception, a mechanical turtle. VB has always lacked even that... - Shog9 04-09-2002 Cats, and most other animals apart from mad cows can write fully functional vb code. - Simon Walton - 6-Aug-2002
Is the code from an Unix/Linux program?
statfs()
appears to be a Linux or BSD Unix syscall, on Linux the documentation says:int statfs(const char \*path, struct statfs \*buf); int fstatfs(int fd, struct statfs \*buf);
DESCRIPTION
statfs returns information about a mounted file system. path is the
path name of any file within the mounted filesystem. buf is a pointer
to a statfs structure defined as follows:struct statfs { long f\_type; /\* type of filesystem (see below) \*/ long f\_bsize; /\* optimal transfer block size \*/ long f\_blocks; /\* total data blocks in file system \*/ long f\_bfree; /\* free blocks in fs \*/ long f\_bavail; /\* free blocks avail to non-superuser \*/ long f\_files; /\* total file nodes in file system \*/ long f\_ffree; /\* free file nodes in fs \*/ fsid\_t f\_fsid; /\* file system id \*/ long f\_namelen; /\* maximum length of filenames \*/ long f\_spare\[6\]; /\* spare for later \*/ };