Access/inspect the filesystem
This module is partial superset of LuaFileSystem 1.8.0 (http://keplerproject.github.io/luafilesystem/). It has been modified to remove functions which do not apply to macOS filesystems and additional functions providing macOS specific filesystem information have been added.
Signature | hs.fs.defaultPathListExcludes -> table |
---|---|
Type | Variable |
Description | A table containing the default list of patterns to ignore when using the hs.fs.fileListForPath. |
Source | extensions/fs/fs.lua line 153 |
Signature | hs.fs.attributes(filepath [, aName]) -> table or string or nil,error |
---|---|
Type | Function |
Description | Gets the attributes of a file |
Parameters |
|
Returns |
|
Notes |
|
Source | extensions/fs/libfs.m line 744 |
Signature | hs.fs.chdir(path) -> true or (nil,error) |
---|---|
Type | Function |
Description | Changes the current working directory to the given path. |
Parameters |
|
Returns |
|
Source | extensions/fs/libfs.m line 129 |
Signature | hs.fs.currentDir() -> string or (nil,error) |
---|---|
Type | Function |
Description | Gets the current working directory |
Parameters |
|
Returns |
|
Source | extensions/fs/libfs.m line 157 |
Signature | hs.fs.dir(path) -> iter_fn, dir_obj, nil, dir_obj |
---|---|
Type | Function |
Description | Creates an iterator for walking a filesystem path |
Parameters |
|
Returns |
|
Notes |
|
Source | extensions/fs/libfs.m line 475 |
Signature | hs.fs.displayName(filepath) -> string |
---|---|
Type | Function |
Description | Returns the display name of the file or directory at a specified path. |
Parameters |
|
Returns |
|
Source | extensions/fs/libfs.m line 1028 |
Signature | hs.fs.fileListForPath(path, [options]) -> table, fileCount, dirCount |
---|---|
Type | Function |
Description | Returns a table containing the paths to all of the files located at the specified path. |
Parameters |
|
Returns |
|
Notes |
|
Source | extensions/fs/libfs.m line 1161 |
Signature | hs.fs.fileUTI(path) -> string or nil |
---|---|
Type | Function |
Description | Returns the Uniform Type Identifier for the file location specified. |
Parameters |
|
Returns |
|
Source | extensions/fs/libfs.m line 940 |
Signature | hs.fs.fileUTIalternate(fileUTI, type) -> string |
---|---|
Type | Function |
Description | Returns the fileUTI's equivalent form in an alternate type specification format. |
Parameters |
|
Returns |
|
Source | extensions/fs/libfs.m line 964 |
Signature | hs.fs.getFinderComments(path) -> string |
---|---|
Type | Function |
Description | Get the Finder comments for the file or directory at the specified path |
Parameters |
|
Returns |
|
Notes |
|
Source | extensions/fs/fs.lua line 68 |
Signature | hs.fs.link(old, new[, symlink]) -> true or (nil,error) |
---|---|
Type | Function |
Description | Creates a link |
Parameters |
|
Returns |
|
Source | extensions/fs/libfs.m line 348 |
Signature | hs.fs.lock(filehandle, mode[, start[, length]]) -> true or (nil,error) |
---|---|
Type | Function |
Description | Locks a file, or part of it |
Parameters |
|
Returns |
|
Source | extensions/fs/libfs.m line 211 |
Signature | hs.fs.lockDir(path, [seconds_stale]) -> lock or (nil,error) |
---|---|
Type | Function |
Description | Locks a directory |
Parameters |
|
Returns |
|
Notes |
|
Source | extensions/fs/libfs.m line 243 |
Signature | hs.fs.mkdir(dirname) -> true or (nil,error) |
---|---|
Type | Function |
Description | Creates a new directory |
Parameters |
|
Returns |
|
Source | extensions/fs/libfs.m line 384 |
Signature | hs.fs.pathFromBookmark(data) -> string | nil, string |
---|---|
Type | Function |
Description | Gets the file path from a binary encoded bookmark. |
Parameters |
|
Returns |
|
Notes |
|
Source | extensions/fs/libfs.m line 1080 |
Signature | hs.fs.pathToAbsolute(filepath) -> string |
---|---|
Type | Function |
Description | Gets the absolute path of a given path |
Parameters |
|
Returns |
|
Source | extensions/fs/libfs.m line 1001 |
Signature | hs.fs.pathToBookmark(path) -> string | nil |
---|---|
Type | Function |
Description | Returns the path as binary encoded bookmark data. |
Parameters |
|
Returns |
|
Source | extensions/fs/libfs.m line 1049 |
Signature | hs.fs.rmdir(dirname) -> true or (nil,error) |
---|---|
Type | Function |
Description | Removes an existing directory |
Parameters |
|
Returns |
|
Source | extensions/fs/libfs.m line 413 |
Signature | hs.fs.setFinderComments(path, comment) -> boolean |
---|---|
Type | Function |
Description | Set the Finder comments for the file or directory at the specified path to the comment specified |
Parameters |
|
Returns |
|
Notes |
|
Source | extensions/fs/fs.lua line 95 |
Signature | hs.fs.symlinkAttributes (filepath [, aname]) -> table or string or nil,error |
---|---|
Type | Function |
Description | Gets the attributes of a symbolic link |
Parameters |
|
Returns |
|
Notes |
|
Source | extensions/fs/fs.lua line 127 |
Signature | hs.fs.temporaryDirectory() -> string |
---|---|
Type | Function |
Description | Returns the path of the temporary directory for the current user. |
Parameters |
|
Returns |
|
Source | extensions/fs/libfs.m line 926 |
Signature | hs.fs.touch(filepath [, atime [, mtime]]) -> true or (nil,error) |
---|---|
Type | Function |
Description | Updates the access and modification times of a file |
Parameters |
|
Returns |
|
Source | extensions/fs/libfs.m line 601 |
Signature | hs.fs.unlock(filehandle[, start[, length]]) -> true or (nil,error) |
---|---|
Type | Function |
Description | Unlocks a file or a part of it. |
Parameters |
|
Returns |
|
Source | extensions/fs/libfs.m line 317 |
Signature | hs.fs.urlFromPath(path) -> string | nil |
---|---|
Type | Function |
Description | Returns the encoded URL from a path. |
Parameters |
|
Returns |
|
Source | extensions/fs/libfs.m line 1132 |