I have written one in my project
this task varies both from OS and filesystem.

https://github.com/digital-world/sakuyamon/blob/master/digitama/posix.c
It works on Solaris/Linux/MacOSX, and collects more sysinfo metrics than
just disk usage.

`ffi_prefab_ksysinfo` is the main struct, and `system_statistics` is the
entrance.
You have to write your own FFI wrapper since currently I am busy in another
project
and that one is bad architected.


On Fri, Nov 4, 2016 at 1:18 AM, David Storrs <david.sto...@gmail.com> wrote:

>
>
> On Thu, Nov 3, 2016 at 12:58 PM, Ethan Estrada <ethan.estr...@gmail.com>
> wrote:
>
>> On Wednesday, November 2, 2016 at 12:20:12 PM UTC-6, David K. Storrs
>> wrote:
>> > I've been looking through the docs for how to check available disk
>> space.  I looked in the  filesystem and os libraries and I threw keywords
>> at the search tool, but I can't find an answer.
>> >
>> > I'm looking for the equivalent of the Unix / OSX "df" command.  I could
>> shell out and parse the output, I suppose, but that seem unportable and
>> error prone.  Is there a builtin for it?
>>
>> I don't know of anything builtin or in the official package repo to do
>> this. Your best short term bet is probably using the kluge you came up
>> with: shelling out to the "df" command and parsing the output.
>>
>> However, it sounds like this functionality is something that could
>> eventually be abstracted into a module using native system libraries and
>> FFI. It would mostly be a research project to find out which system
>> libraries one would need. If I had more time right now, I'd work on it
>> myself to get more hands on racket experience.
>>
>>
> Okay, good to know.  Thanks!
>
>
>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "Racket Users" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to racket-users+unsubscr...@googlegroups.com.
>> For more options, visit https://groups.google.com/d/optout.
>>
>
> --
> You received this message because you are subscribed to the Google Groups
> "Racket Users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to racket-users+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Racket Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to racket-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to