From dfde2dfef36ec1604173ff26fbf18147815966f3 Mon Sep 17 00:00:00 2001 From: erg <erg@ubuntubox.(none)> Date: Mon, 1 Dec 2008 16:28:22 -0600 Subject: [PATCH] fix file-system-info on linux --- basis/io/unix/files/linux/linux.factor | 27 ++++++++++++++------------ basis/unix/statfs/linux/linux.factor | 5 +---- basis/unix/statvfs/linux/linux.factor | 2 +- 3 files changed, 17 insertions(+), 17 deletions(-) diff --git a/basis/io/unix/files/linux/linux.factor b/basis/io/unix/files/linux/linux.factor index 584015711f..dd9abcbd1e 100644 --- a/basis/io/unix/files/linux/linux.factor +++ b/basis/io/unix/files/linux/linux.factor @@ -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 ; diff --git a/basis/unix/statfs/linux/linux.factor b/basis/unix/statfs/linux/linux.factor index eb587e3286..6550ee572e 100644 --- a/basis/unix/statfs/linux/linux.factor +++ b/basis/unix/statfs/linux/linux.factor @@ -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 diff --git a/basis/unix/statvfs/linux/linux.factor b/basis/unix/statvfs/linux/linux.factor index 008692a501..3bfbffa197 100644 --- a/basis/unix/statvfs/linux/linux.factor +++ b/basis/unix/statvfs/linux/linux.factor @@ -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 ) ;