Skip to content

Commit

Permalink
Added new FtpListOption.UseLS flag (implies FtpListOption.ForceList) …
Browse files Browse the repository at this point in the history
…that tells GetListing() to use "LS" instead of "LIST" for file listings. As of right now this feature is untested.
  • Loading branch information
jptrosclair committed Feb 8, 2014
1 parent e83f56c commit ac9b5bf
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
5 changes: 4 additions & 1 deletion System.Net.FtpClient/FtpClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1840,7 +1840,10 @@ public FtpListItem[] GetListing(string path, FtpListOption options) {
listcmd = "MLSD";
}
else {
if ((options & FtpListOption.NameList) == FtpListOption.NameList) {
if ((options & FtpListOption.UseLS) == FtpListOption.UseLS) {
listcmd = "LS";
}
else if ((options & FtpListOption.NameList) == FtpListOption.NameList) {
listcmd = "NLST";
}
else {
Expand Down
8 changes: 7 additions & 1 deletion System.Net.FtpClient/FtpEnums.cs
Original file line number Diff line number Diff line change
Expand Up @@ -392,6 +392,12 @@ public enum FtpListOption {
/// <summary>
/// Try to dereference symbolic links
/// </summary>
DerefLinks = 32
DerefLinks = 32,
/// <summary>
/// Sets the ForceList flag and uses `LS' instead of `LIST' as the
/// command for getting a directory listing. This option overrides
/// ForceNameList and ignores the AllFiles flag.
/// </summary>
UseLS = 64 | ForceList
}
}

0 comments on commit ac9b5bf

Please sign in to comment.