fix file-system-info on linux
parent
72db24ad65
commit
dfde2dfef3
|
@ -1,12 +1,15 @@
|
||||||
! Copyright (C) 2008 Doug Coleman.
|
! Copyright (C) 2008 Doug Coleman.
|
||||||
! See http://factorcode.org/license.txt for BSD license.
|
! 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
|
IN: io.unix.files.linux
|
||||||
|
|
||||||
TUPLE: linux-file-system-info < unix-file-system-info
|
TUPLE: linux-file-system-info < unix-file-system-info
|
||||||
namelen spare ;
|
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 )
|
M: linux file-system-statfs ( path -- byte-array )
|
||||||
"statfs64" <c-object> tuck statfs64 io-error ;
|
"statfs64" <c-object> tuck statfs64 io-error ;
|
||||||
|
@ -35,16 +38,6 @@ M: linux statvfs>file-system-info ( struct -- statfs )
|
||||||
[ statvfs64-f_namemax >>name-max ]
|
[ statvfs64-f_namemax >>name-max ]
|
||||||
} cleave ;
|
} 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
|
TUPLE: mtab-entry file-system-name mount-point type options
|
||||||
frequency pass-number ;
|
frequency pass-number ;
|
||||||
|
|
||||||
|
@ -65,3 +58,13 @@ frequency pass-number ;
|
||||||
CHAR: \s delimiter set csv
|
CHAR: \s delimiter set csv
|
||||||
] with-scope
|
] with-scope
|
||||||
[ mtab-csv>mtab-entry ] map ;
|
[ 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 ;
|
||||||
|
|
|
@ -1,9 +1,6 @@
|
||||||
! Copyright (C) 2008 Doug Coleman.
|
! Copyright (C) 2008 Doug Coleman.
|
||||||
! See http://factorcode.org/license.txt for BSD license.
|
! See http://factorcode.org/license.txt for BSD license.
|
||||||
USING: alien.c-types combinators kernel unix.stat
|
USING: alien.syntax ;
|
||||||
math accessors system unix io.backend layouts vocabs.loader
|
|
||||||
sequences csv io.streams.string io.encodings.utf8 namespaces
|
|
||||||
unix.statfs io.files ;
|
|
||||||
IN: unix.statfs.linux
|
IN: unix.statfs.linux
|
||||||
|
|
||||||
C-STRUCT: statfs64
|
C-STRUCT: statfs64
|
||||||
|
|
|
@ -14,7 +14,7 @@ C-STRUCT: statvfs64
|
||||||
{ "__fsfilcnt64_t" "f_favail" }
|
{ "__fsfilcnt64_t" "f_favail" }
|
||||||
{ "ulong" "f_fsid" }
|
{ "ulong" "f_fsid" }
|
||||||
{ "ulong" "f_flag" }
|
{ "ulong" "f_flag" }
|
||||||
{ "ulong" f_namemax" }
|
{ "ulong" "f_namemax" }
|
||||||
{ { "int" 6 } "__f_spare" } ;
|
{ { "int" 6 } "__f_spare" } ;
|
||||||
|
|
||||||
FUNCTION: int statvfs64 ( char* path, statvfs64* buf ) ;
|
FUNCTION: int statvfs64 ( char* path, statvfs64* buf ) ;
|
||||||
|
|
Loading…
Reference in New Issue