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 )

Vocabulary
io.files.info

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

USING: system ;

IN: io.files.info

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 ;