Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. I dont know...

I dont know...

Scheduled Pinned Locked Moved C / C++ / MFC
question
5 Posts 4 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • C Offline
    C Offline
    Coremn
    wrote on last edited by
    #1

    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:

    J C 2 Replies Last reply
    0
    • C Coremn

      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:

      J Offline
      J Offline
      jhwurmbach
      wrote on last edited by
      #2

      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 showed statfs() 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

      C 1 Reply Last reply
      0
      • C Coremn

        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:

        C Offline
        C Offline
        Christian Graus
        wrote on last edited by
        #3

        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

        M 1 Reply Last reply
        0
        • J jhwurmbach

          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 showed statfs() 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

          C Offline
          C Offline
          Coremn
          wrote on last edited by
          #4

          Thanks dudes - it will help The cheque is in the mail.:) ---

          1 Reply Last reply
          0
          • C Christian Graus

            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

            M Offline
            M Offline
            markkuk
            wrote on last edited by
            #5

            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 \*/
                      };
            
            1 Reply Last reply
            0
            Reply
            • Reply as topic
            Log in to reply
            • Oldest to Newest
            • Newest to Oldest
            • Most Votes


            • Login

            • Don't have an account? Register

            • Login or register to search.
            • First post
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • World
            • Users
            • Groups