Fs.FileStat
eff FileStatSourceAn effect used to read file metadata (test, permissions, timestamps, size).
Operations
Returns the last access time of the given file f in milliseconds since the epoch.
Returns the creation time of the given file f in milliseconds since the epoch.
Returns true if the given file f exists.
Returns true if the given file f is a directory.
Returns true if the given file f is executable.
Returns true if the given file f is readable.
Returns true if the given file f is a regular file.
Returns true if the given file f is a symbolic link.
Returns true if the given file f is writable.
Returns the last-modified timestamp of the given file f in milliseconds since the epoch.
Definitions
Handles the FileStat effect of the given function f.
In other words, re-interprets the FileStat effect using the IO effect.
Handles the FileStat effect of the given function f using the FileSystem effect.
@DefaultHandler Runs the FileStat effect of the given function f.
In other words, re-interprets the FileStat effect using the IO effect.
Middleware that intercepts the FileStat effect, validating that all file paths
match at least one of the given glob patterns. Rejects paths that do not match
with a PermissionDenied error.
def withAllowList(allowedDirs: Nel[String], f: Unit -> a \ ef): a \ (ef - FileStat) + FileStat§ SourceMiddleware that intercepts the FileStat effect, validating that all file paths
resolve within one of the given allowedDirs. Rejects paths outside the
allow list with a PermissionDenied error.
Middleware that intercepts the FileStat effect, resolving all file paths
relative to the given baseDir using Java's Path.resolve semantics.
Absolute paths are passed through unchanged.
Middleware that intercepts the FileStat effect, validating that all file paths
resolve within the given chrootDir. Rejects paths that escape the chroot with
a PermissionDenied error.
Middleware that intercepts the FileStat effect, validating that all file paths
do not match any of the given glob patterns. Rejects paths that match a denied
pattern with a PermissionDenied error.
def withDenyList(deniedDirs: Nel[String], f: Unit -> a \ ef): a \ (ef - FileStat) + FileStat§ SourceMiddleware that intercepts the FileStat effect, validating that all file paths
do not resolve within any of the given deniedDirs. Rejects paths inside a
denied directory with a PermissionDenied error.
Middleware that intercepts the FileStat effect, resolving all file paths
to their real filesystem targets by following symlinks.
- Bool ops (
exists,isDirectory, etc.): resolve path; returnOk(false)for dangling symlinks. - Value ops (
accessTime,size, etc.): resolve path; propagate all errors. isSymbolicLink: passed through unchanged (always checks the link itself).