module

Dust::Platform

Thin wrapper around libc's stat/lstat.

Crystal's File::Info exposes neither inode/device nor st_blocks, both of which dust needs (hard link detection and real disk usage), so every stat in the program goes through here.

Constants

BLOCK_SIZE = 512_u64

All unix implementations report st_blocks in 512 byte units, no matter what st_blksize says.

PREALLOC_BLOCKS = 65536_u64

Slack for filesystems that pre-allocate more space than strictly needed.

Instance methods

kind_of(stat : LibC::Stat) : FileKind
Source
lstat(path : String) : LibC::Stat | Nil
Source
metadata_from(stat : LibC::Stat | Nil, apparent : Bool = false) : MetaData | Nil

Same, from an already obtained stat (the walk stats every entry once).

Source
stat(path : String) : LibC::Stat | Nil
Source