Skip to content

GetDir2

Lists a directory from a remote environment with additional information.

1
myDocumentFiles.GetDir2(options: FileTransferOptions):Array<RemoveFileInfo>

Parameters

FileTransferOptions options
    The transfer options.

Returns

An array of entries with the name and a flag that tells whether the entry is a directory.

Examples

List only the files of a directory

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
var names = $Files.GetDir2({
    RemoteHost : 'ftp.example.com',
    RemotePath : 'outgoing',
    UserName : 'transfer',
    Password : 'secret'
})
.filter(function (entry) {
    return !entry.IsDirectory;
})
.map(function (entry) {
    return entry.Name;
});

See Also