Module ringo/fileutils
A collection of file related utilities.
Functions
- createTempFile(prefix, suffix)
- resolveId(parent, child)
- resolveUri()
createTempFile (prefix, suffix)
Create a new empty temporary file in the default directory for temporary files.
Parameters
| String | prefix | the prefix of the temporary file; must be at least three characters long |
| String | suffix | the suffix of the temporary file; may be null |
Returns
| File | the temporary file |
resolveId (parent, child)
Resolve path fragment child relative to parent but only if child is a a relative path according to the Securable Modules spec, i.e. starts with "." or "..". Otherwise, the child path is returned unchanged.
Parameters
| String | parent | the parent path |
| String | child | the child path |
resolveUri ()
Resolve an arbitrary number of path elements relative to each other. This is an adapted version of the file module's resolve function that always and strictly uses forward slashes as file separators. This makes it usable for resolving URI paths as well as module ids and resource paths. Originally adapted for helma/file from narwhal's file module.
roots
An Array containing the system's file system roots. On UNIX platforms this contains a single "/" directory, while on Windows platforms this contains an element for each mounted drive.
separator
The system-dependent file system separator character.
