Table of Contents

Class SftpListOptions

Namespace
SshSharp.Sftp
Assembly
SshSharp.dll
public sealed class SftpListOptions
Inheritance
SftpListOptions
Inherited Members

Properties

FollowSymbolicLinks

In a recursive listing, enter symbolic links that lead to directories (default false: links are listed, described by their own attributes, and not entered). Each link costs two extra round trips (its target's attributes, and its real path); a dangling link, or one whose target cannot be looked at, is listed and not entered. A link back to a directory the listing is already inside (a loop) is not entered.

IgnoreCase

Match Pattern without regard to case (default false: case-sensitive), as fnmatch's FNM_CASEFOLD does: *.jpg then also lists IMG_01.JPG, and [a-z] also takes Q. For trees that came from Windows, or a server on Windows, where names differ in case only by accident. Characters are compared by the invariant culture's simple case mapping, so the result does not depend on this machine's culture; it does not change which directories a recursive listing enters.

MaxConcurrentDirectories

How many subdirectories a recursive listing reads at once, ahead of the entries being returned (default 4, at most 64). Each holds a directory handle while it is read; when the server announces MaxOpenHandles, fewer are read at once if needed, keeping a handle free. It also bounds the memory: at most this many listings read ahead are held until the listing reaches them, besides those of the directories it is inside.

MaxDepth

How many levels a recursive listing goes down (default 64, as directory transfers): 1 lists the directory's own entries, 2 also those of its subdirectories, and so on. Directories at the last level are listed but not entered. Unlike a directory transfer, which fails on a deeper tree, a listing just stops descending.

Pattern

List only the entries whose name matches this shell-style pattern; null (the default) lists every entry. matches any run of characters, ? any one character, and [...] one character of a set: [abc], a range [0-9], or a negated set [!a-z] (or [^a-z]); </code> takes the next character literally. The match is on the whole name (not the path) and case-sensitive, as on the POSIX file systems most servers have. Unlike a shell, and ? also match a leading dot, so includes hidden files. In a recursive listing the pattern selects the entries returned, not the directories descended into: .log finds the log files at every level, as find -name does.

Recursive

List the subdirectories too, and theirs, depth first: a directory's subtree follows its own entry, before its later siblings, with each directory's entries in the server's order, unsorted (default false: the directory's entries only).

SkipUnreadableDirectories

In a recursive listing, leave out a subdirectory the server will not let this user read (PermissionDenied) and go on with the entries after it, as find does after its warning (default false: the listing ends with the SftpException). The subdirectory's own entry is still returned (when it matches Pattern), as it comes before its contents; UnreadableDirectory is told about each one left out.

UnreadableDirectory

With SkipUnreadableDirectories, called with the entry of each subdirectory that was left out because it could not be read, when the listing reaches it: after its own entry, before the entries the server listed after it. It is called from within the caller's enumeration, between two entries, never concurrently; an exception it throws ends the listing. Null (the default) leaves the directories out silently.