file-system-info ( path -- file-system-info ) (original) (raw)
file-system-info ( path -- file-system-info )
Factor handbook » Input and output » File system metadata
Prev: | file-executable? ( path -- ? ) |
---|---|
Next: | file-systems ( -- array ) |
Inputs
path | a pathname string |
---|
Outputs
file-system-info | a file-system-info-tuple |
---|
Word description
Returns a platform-specific object describing the file-system that contains the path. The cross-platform slot is free-space.
Examples
USING: io.files.info io.pathnames math prettyprint ; IN: scratchpad : gb ( m -- n ) 30 2^ * ; home file-system-info free-space>> 100 gb < .
f
Definition
HOOK: file-system-info os ( path -- file-system-info )
Methods
USING: io.backend io.files.info io.files.info.unix kernel system
;
M: unix file-system-info
normalize-path [ new-file-system-info ] dip
[ file-system-statfs statfs>file-system-info ]
[ file-system-statvfs statvfs>file-system-info ] bi
file-system-calculations ;