1 ! Copyright (C) 2008 Doug Coleman, Eduardo Cavazos.
2 ! See http://factorcode.org/license.txt for BSD license.
3 USING: accessors kernel system sequences combinators
4 vocabs.loader io.files.types ;
8 TUPLE: file-info type size permissions created modified
11 HOOK: file-info os ( path -- info )
13 HOOK: link-info os ( path -- info )
15 : directory? ( file-info -- ? ) type>> +directory+ = ;
18 HOOK: file-systems os ( -- array )
20 TUPLE: file-system-info device-name mount-point type
21 available-space free-space used-space total-space ;
23 HOOK: file-system-info os ( path -- file-system-info )
26 { [ os unix? ] [ "io.files.info.unix." os name>> append ] }
27 { [ os windows? ] [ "io.files.info.windows" ] }