! 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 ;
[ 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 ;
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 ;
! 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
{ "__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 ) ;