files

lumin. files

Methods

(static) CanRead(filePath) → {boolean}

Tests whether the file can be opened for reading.

Parameters:
Name Type Description
filePath string

path to the file

Returns:

true if the file is readable; false otherwise

Type
boolean

(static) Extension(filepath) → {string}

Returns the extension for a file.

Parameters:
Name Type Description
filepath string

path to the file

Returns:

File extension deduced from filepath;
e.g. "foo/bar.txt" -> "txt"

Type
string

(static) FileName(filepath) → {string}

Returns the file name

Parameters:
Name Type Description
filepath string
Returns:

file name deduced from filepath.
E.g. "foo/bar/baz.txt" -> "baz.txt"

Type
string

(static) ParentFolder(filepath) → {string}

Returns the parent folder of a file.

Parameters:
Name Type Description
filepath string
Returns:

Parent folder deduced from filepath.
E.g. "foo/bar/baz.txt" -> "foo/bar"

Type
string