On Sep 15, 2009, at 2:28 PM, James Turnbull wrote:

> Thomas Bellman wrote:
>> Christian Hofstaedtler wrote:
>>
>>> You probably can't avoid `df` if you want something which works for
>>> anything else than Linux too.
>>
>> Of course, the output from df differs between different Unixes...
>>
>
> And I sense the maze of twisty little passages that are all alike
> that we ventured down for the interface facts but you could take a
> look at that code to see how different output was parsed (or not
> depending on how people feel about that code... :) ).

df starts from a better place than ifconfig though because it's got  
standardised output with '-P' POSIX mode -- so the only trick is  
special-casing *nixes which don't support the flag.  Sadly there's no  
"File.statfs()" in core analogous to File.stat().   You'd end up  
pulling in or redoing sys-filesystem from http://rubyforge.org/projects/sysutils

ifconfig is indeed a particularly degenerate example.

-=Eric



--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Puppet Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/puppet-dev?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to