Re: statvfs clearance

2009-04-05 Thread Scott David Daniels

Dave Angel wrote:
The term we used to use for these is magic numbers.   Using 
magic-numbers directly in your code is a good way to ensure future time 
debugging.


And perhaps, in these job-scarce days, future employment.
I am reminded of a saying we had in the OS group at TymShare:
A wizard is someone who can fix his own mistakes quickly.
Heaven save us from wizards.

--Scott David Daniels
scott.dani...@acm.org

--
http://mail.python.org/mailman/listinfo/python-list


Re: statvfs clearance

2009-04-05 Thread Cameron Simpson
On 04Apr2009 03:56, Sreejith K sreejith...@gmail.com 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.
[...]
| 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

Since os.statvfs is a wrapper for the OS statvfs system call, I would
consult man statvfs on your platform. That will tell you about the OS
facility underlying the python library function.
-- 
Cameron Simpson c...@zip.com.au DoD#743
http://www.cskk.ezoshosting.com/cs/
--
http://mail.python.org/mailman/listinfo/python-list


Re: statvfs clearance

2009-04-04 Thread Albert Hopkins
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?


--
http://mail.python.org/mailman/listinfo/python-list


Re: statvfs clearance

2009-04-04 Thread Hrvoje Niksic
Sreejith K sreejith...@gmail.com 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
--
http://mail.python.org/mailman/listinfo/python-list


Re: statvfs clearance

2009-04-04 Thread Albert Hopkins
On Sat, 2009-04-04 at 15:48 +0200, Hrvoje Niksic wrote:
 Sreejith K sreejith...@gmail.com 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


--
http://mail.python.org/mailman/listinfo/python-list


Re: statvfs clearance

2009-04-04 Thread Dave Angel



Hrvoje Niksic wrote:

Sreejith K sreejith...@gmail.com 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



  

The following web page describes them:
   http://docs.python.org/library/statvfs.html
but you already knew that much.  So what are you really asking for?

You can simply print them, they are integers:

  

import statvfs
statvfs.F_FLAG


8

  
But those values may be specific to a particular python implementation.  
No reason to assume they'd be the same across OS platforms, or between 
versions 2.5 and 2.6.  The whole thing is deprecated, and is eliminated 
in 3.0


The term we used to use for these is magic numbers.   Using 
magic-numbers directly in your code is a good way to ensure future time 
debugging.


--
http://mail.python.org/mailman/listinfo/python-list