MaybeFile type

Like File but the programmer is aware that it might not exist. Therefore, no exceptions will be thrown for most operations on the file if it is not present.

Direct parent types

File
Represents a file in a file system (S_IFREG)
Direct subtypes: 2

Methods

fetch(f:MaybeFile, decode_hints:Hash={}, dflt:Any=null)
Fetches the file using previously defined fetch()

Returns

Like fetch(File, ...) or dflt if the file is not present.
lines(f:MaybeFile, cb:Fun)
Like lines(File) but cb is never called if the file is not present
read(f:MaybeFile, dflt:Any=null)
Reads the whole file using previously defined read()

Returns

Like read(File) or dflt if the file is not present.