fix file-system-info on linux

db4
erg 2008-12-01 16:28:22 -06:00
parent 72db24ad65
commit dfde2dfef3
3 changed files with 17 additions and 17 deletions

View File

@ -1,12 +1,15 @@
! Copyright (C) 2008 Doug Coleman.
! See http://factorcode.org/license.txt for BSD license.
USING: accessors alien.c-types alien.syntax combinators csv
io.encodings.utf8 io.files io.streams.string io.unix.files
kernel namespaces sequences system unix unix.statfs.linux
unix.statvfs.linux ;
IN: io.unix.files.linux
TUPLE: linux-file-system-info < unix-file-system-info
namelen spare ;
M: linux new-file-system-info unix-file-system-info new ;
M: linux new-file-system-info linux-file-system-info new ;
M: linux file-system-statfs ( path -- byte-array )
"statfs64" <c-object> tuck statfs64 io-error ;
@ -35,16 +38,6 @@ M: linux statvfs>file-system-info ( struct -- statfs )
[ statvfs64-f_namemax >>name-max ]
} cleave ;
M: linux file-systems
parse-mtab [
[ mount-point>> file-system-info ] keep
{
[ file-system-name>> >>device-name ]
[ mount-point>> >>mount-point ]
[ type>> >>type ]
} cleave
] map ;
TUPLE: mtab-entry file-system-name mount-point type options
frequency pass-number ;
@ -65,3 +58,13 @@ frequency pass-number ;
CHAR: \s delimiter set csv
] with-scope
[ mtab-csv>mtab-entry ] map ;
M: linux file-systems
parse-mtab [
[ mount-point>> file-system-info ] keep
{
[ file-system-name>> >>device-name ]
[ mount-point>> >>mount-point ]
[ type>> >>type ]
} cleave
] map ;

View File

@ -1,9 +1,6 @@
! Copyright (C) 2008 Doug Coleman.
! See http://factorcode.org/license.txt for BSD license.
USING: alien.c-types combinators kernel unix.stat
math accessors system unix io.backend layouts vocabs.loader
sequences csv io.streams.string io.encodings.utf8 namespaces
unix.statfs io.files ;
USING: alien.syntax ;
IN: unix.statfs.linux
C-STRUCT: statfs64

View File

@ -14,7 +14,7 @@ C-STRUCT: statvfs64
{ "__fsfilcnt64_t" "f_favail" }
{ "ulong" "f_fsid" }
{ "ulong" "f_flag" }
{ "ulong" f_namemax" }
{ "ulong" "f_namemax" }
{ { "int" 6 } "__f_spare" } ;
FUNCTION: int statvfs64 ( char* path, statvfs64* buf ) ;