From: Edwin van Leeuwen Date: 2006-01-25T03:54:54+09:00 Subject: Re: Disk Free Space Mickael Faivre-Macon wrote: > Hi, > > Is a way to know free disk space left other that using Win32 API or a > system call on linux ? > > Mickael. A way to directly make the correct system call from ruby: size = 64 unpack_fmt = 'iiiiiiiiiiiiiiii' foo = ' ' * size syscall(99, "/mountpoint", foo) type, @bsize, @blocks, @bfree, @bavail, @files, @ffree, tmp,tmp,@namelen = foo.unpack(unpack_fmt) usage=100*(@blocks-@bfree)/@blocks (Copied from someone who wrote a ruby script that did the same thing as df.) Edwin -- Posted via http://www.ruby-forum.com/.