On 1/19/07, Kent Johnson <[EMAIL PROTECTED]> wrote:
> The attribute access uses . notation and an attribute name. You can do
> stat.f_blocks and gstat.gr_gid. Python takes care of looking up the
> actual attribute value.
Excellent - thank you.
> I suggest you use the attribute form for both, it
Steve Nelson wrote:
> On 9/22/06, Steve Nelson <[EMAIL PROTECTED]> wrote:
>
>> In the end I just did:
>>
>> def fsUsage(dir):
>> """Returns the % usage of a given filesystem"""
>> stat = os.statvfs(dir)
>> from statvfs import F_BLOCKS, F_BFREE
>> total = stat[F_BLOCKS]
>> avail = stat[F_
On 9/22/06, Steve Nelson <[EMAIL PROTECTED]> wrote:
> In the end I just did:
>
> def fsUsage(dir):
> """Returns the % usage of a given filesystem"""
> stat = os.statvfs(dir)
> from statvfs import F_BLOCKS, F_BFREE
> total = stat[F_BLOCKS]
> avail = stat[F_BFREE]
> used = total-avail
>
On 9/22/06, wesley chun <[EMAIL PROTECTED]> wrote:
> this sounds like it will require some work to implement 'df' in
> Python
Mmm... although I have discovered a debian package called pydf whose
source made interesting reading.
> i'd use the one of
> the {os,popen2}.popen*() functions or the sub
> How can I go about getting info similar to that which the UNIX df
> command provides - of filesystem usage and inode usage? I could just
> shell out and run a df command, but I would rather use python
> bindings.
this sounds like it will require some work to implement 'df' in
Python, *and* it w