statvfs clearance

Discussion in 'Python' started by Sreejith K, Apr 4, 2009.

  1. Sreejith K

    Sreejith K Guest

    Python's statvfs module contains the following indexes to use with
    os.statvfs() that contains the specified information

    statvfs.F_BSIZE
    Preferred file system block size.

    statvfs.F_FRSIZE
    Fundamental file system block size.

    statvfs.F_BLOCKS
    Total number of blocks in the filesystem.

    statvfs.F_BFREE
    Total number of free blocks.

    statvfs.F_BAVAIL
    Free blocks available to non-super user.

    statvfs.F_FILES
    Total number of file nodes.

    statvfs.F_FFREE
    Total number of free file nodes.

    statvfs.F_FAVAIL
    Free nodes available to non-super user.

    statvfs.F_FLAG
    Flags. System dependent: see statvfs man page.

    statvfs.F_NAMEMAX
    Maximum file name length.

    Can anyone tell me (or give me some links to know) what are these
    values ? The first three I know, I need to know about the rest....
     
    Sreejith K, Apr 4, 2009
    #1
    1. Advertising

  2. On Sat, 2009-04-04 at 03:56 -0700, Sreejith K wrote:
    > Python's statvfs module contains the following indexes to use with
    > os.statvfs() that contains the specified information
    >
    > statvfs.F_BSIZE
    > Preferred file system block size.
    >
    > statvfs.F_FRSIZE
    > Fundamental file system block size.
    >
    > statvfs.F_BLOCKS
    > Total number of blocks in the filesystem.
    >
    > statvfs.F_BFREE
    > Total number of free blocks.
    >
    > statvfs.F_BAVAIL
    > Free blocks available to non-super user.
    >
    > statvfs.F_FILES
    > Total number of file nodes.
    >
    > statvfs.F_FFREE
    > Total number of free file nodes.
    >
    > statvfs.F_FAVAIL
    > Free nodes available to non-super user.
    >
    > statvfs.F_FLAG
    > Flags. System dependent: see statvfs man page.
    >
    > statvfs.F_NAMEMAX
    > Maximum file name length.
    >
    > Can anyone tell me (or give me some links to know) what are these
    > values ? The first three I know, I need to know about the rest....


    The values would obviously depend on your particular system, which we
    don't have. So how could we, for example, know how many free blocks you
    have on your filesystem?
     
    Albert Hopkins, Apr 4, 2009
    #2
    1. Advertising

  3. Sreejith K <> writes:

    > Python's statvfs module contains the following indexes to use with
    > os.statvfs() that contains the specified information
    >
    > statvfs.F_BSIZE
    > Preferred file system block size.

    [...]
    > statvfs.F_NAMEMAX
    > Maximum file name length.
    >
    > Can anyone tell me (or give me some links to know) what are these
    > values ? The first three I know, I need to know about the rest....


    You can simply print them, they are integers:

    >>> import statvfs
    >>> statvfs.F_FLAG

    8
     
    Hrvoje Niksic, Apr 4, 2009
    #3
  4. On Sat, 2009-04-04 at 15:48 +0200, Hrvoje Niksic wrote:
    > Sreejith K <> writes:
    >
    > > Python's statvfs module contains the following indexes to use with
    > > os.statvfs() that contains the specified information
    > >
    > > statvfs.F_BSIZE
    > > Preferred file system block size.

    > [...]
    > > statvfs.F_NAMEMAX
    > > Maximum file name length.
    > >
    > > Can anyone tell me (or give me some links to know) what are these
    > > values ? The first three I know, I need to know about the rest....

    >
    > You can simply print them, they are integers:
    >
    > >>> import statvfs
    > >>> statvfs.F_FLAG

    > 8
    > --


    Oh, did the OP mean the values of the indices? Yeah, of course you can
    just print them. Or even look at statvfs.py. It's a whopping 15 lines:

    """Constants for interpreting the results of os.statvfs() and
    os.fstatvfs()."""

    # Indices for statvfs struct members in the tuple returned by
    # os.statvfs() and os.fstatvfs().

    F_BSIZE = 0 # Preferred file system block size
    F_FRSIZE = 1 # Fundamental file system block size
    F_BLOCKS = 2 # Total number of file system blocks (FRSIZE)
    F_BFREE = 3 # Total number of free blocks
    F_BAVAIL = 4 # Free blocks available to non-superuser
    F_FILES = 5 # Total number of file nodes
    F_FFREE = 6 # Total number of free file nodes
    F_FAVAIL = 7 # Free nodes available to non-superuser
    F_FLAG = 8 # Flags (see your local statvfs man page)
    F_NAMEMAX = 9 # Maximum file name length
     
    Albert Hopkins, Apr 4, 2009
    #4
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Korthrun

    statvfs

    Korthrun, Oct 29, 2007, in forum: Python
    Replies:
    2
    Views:
    437
    Korthrun
    Oct 30, 2007
  2. AShopper.net

    Clearance!

    AShopper.net, Dec 12, 2008, in forum: Java
    Replies:
    0
    Views:
    394
    AShopper.net
    Dec 12, 2008
Loading...

Share This Page