-
list([< string >path, ][< boolean >useCompression, ]< function >callback) - (void) - Retrieves the directory listing of path
. path
defaults to the current working directory. useCompression
defaults to false. callback
has 2 parameters: < Error >err, < array >list. list
is an array of objects with these properties:
* type - _string_ - A single character denoting the entry type: 'd' for directory, '-' for file (or 'l' for symlink on **\*NIX only**).
* name - _string_ - The name of the entry.
* size - _string_ - The size of the entry in bytes.
* date - _Date_ - The last modified date of the entry.
* rights - _object_ - The various permissions for this entry **(*NIX only)**.
* user - _string_ - An empty string or any combination of 'r', 'w', 'x'.
* group - _string_ - An empty string or any combination of 'r', 'w', 'x'.
* other - _string_ - An empty string or any combination of 'r', 'w', 'x'.
* owner - _string_ - The user name or ID that this entry belongs to **(*NIX only)**.
* group - _string_ - The group name or ID that this entry belongs to **(*NIX only)**.
* target - _string_ - For symlink entries, this is the symlink's target **(*NIX only)**.
-
get(< string >path, [< boolean >useCompression, ]< function >callback) - (void) - Retrieves a file at path
from the server. useCompression
defaults to false. callback
has 2 parameters: < Error >err, < ReadableStream >fileStream.
-
put(< mixed >input, < string >destPath, [< boolean >useCompression, ]< function >callback) - (void) - Sends data to the server to be stored as destPath
. input
can be a ReadableStream, a Buffer, or a path to a local file. useCompression
defaults to false. callback
has 1 parameter: < Error >err.
-
append(< mixed >input, < string >destPath, [< boolean >useCompression, ]< function >callback) - (void) - Same as put(), except if destPath
already exists, it will be appended to instead of overwritten.
-
rename(< string >oldPath, < string >newPath, < function >callback) - (void) - Renames oldPath
to newPath
on the server. callback
has 1 parameter: < Error >err.
-
delete(< string >path, < function >callback) - (void) - Deletes a file, path
, on the server. callback
has 1 parameter: < Error >err.
-
cwd(< string >path, < function >callback) - (void) - Changes the current working directory to path
. callback
has 2 parameters: < Error >err, < string >currentDir. Note: currentDir
is only given if the server replies with the path in the response text.
-
abort(< function >callback) - (void) - Aborts the current data transfer (e.g. from get(), put(), or list()). callback
has 1 parameter: < Error >err.
-
site(< string >command, < function >callback) - (void) - Sends command
(e.g. 'CHMOD 755 foo', 'QUOTA') using SITE. callback
has 3 parameters: < Error >err, < _string >responseText, < integer >responseCode.
-
status(< function >callback) - (void) - Retrieves human-readable information about the server's status. callback
has 2 parameters: < Error >err, < string >status.
-
ascii(< function >callback) - (void) - Sets the transfer data type to ASCII. callback
has 1 parameter: < Error >err.
-
binary(< function >callback) - (void) - Sets the transfer data type to binary (default at time of connection). callback
has 1 parameter: < Error >err.
-
mkdir(< string >path, [< boolean >recursive, ]< function >callback) - (void) - Creates a new directory, path
, on the server. recursive
is for enabling a 'mkdir -p' algorithm and defaults to false. callback
has 1 parameter: < Error >err.
-
rmdir(< string >path, < function >callback) - (void) - Removes a directory, path
, on the server. callback
has 1 parameter: < Error >err.
-
cdup(< function >callback) - (void) - Changes the working directory to the parent of the current directory. callback
has 1 parameter: < Error >err.
-
pwd(< function >callback) - (void) - Retrieves the current working directory. callback
has 2 parameters: < Error >err, < string >cwd.
-
system(< function >callback) - (void) - Retrieves the server's operating system. callback
has 2 parameters: < Error >err, < string >OS.
-
listSafe([< string >path, ][< boolean >useCompression, ]< function >callback) - (void) - Similar to list(), except the directory is temporarily changed to path
to retrieve the directory listing. This is useful for servers that do not handle characters like spaces and quotes in directory names well for the LIST command. This function is "optional" because it relies on pwd() being available.