Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rename FEAT capability MLSD -> MLST #1636

Merged
merged 1 commit into from
Aug 24, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion FluentFTP.Tests/Unit/ParserTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ private static void TestParsing(FtpListParser parser, string path, string[] test
public void Machine() {

var client = new FtpClient();
client.SetFeatures(new List<FtpCapability> { FtpCapability.MLSD });
client.SetFeatures(new List<FtpCapability> { FtpCapability.MLST });
var parser = new FtpListParser(client);
parser.Init(FtpOperatingSystem.Unix, FtpParser.Machine);

Expand Down
2 changes: 1 addition & 1 deletion FluentFTP/Client/AsyncClient/Connect.cs
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,7 @@ await m_stream.ActivateEncryptionAsync(Host,
// FIX : #739 prefer using machine listings to fix issues with GetListing and DeleteDirectory
if (Config.ListingParser != FtpParser.Custom) {
Config.ListingParser = ServerHandler != null ? ServerHandler.GetParser() : FtpParser.Auto;
if (HasFeature(FtpCapability.MLSD)) {
if (HasFeature(FtpCapability.MLST)) {
Config.ListingParser = FtpParser.Machine;
}
}
Expand Down
4 changes: 2 additions & 2 deletions FluentFTP/Client/AsyncClient/GetObjectInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ public partial class AsyncFtpClient {
/// Return information about a remote file system object asynchronously.
/// </summary>
/// <remarks>
/// You should check the <see cref="BaseFtpClient.Capabilities"/> property for the <see cref="FtpCapability.MLSD"/>
/// You should check the <see cref="BaseFtpClient.Capabilities"/> property for the <see cref="FtpCapability.MLST"/>
/// flag before calling this method. Failing to do so will result in an InvalidOperationException
/// being thrown when the server does not support machine listings. Returns null if the server response can't
/// be parsed or the server returns a failure completion code. The error for a failure
Expand All @@ -41,7 +41,7 @@ public partial class AsyncFtpClient {

FtpReply reply;

var supportsMachineList = HasFeature(FtpCapability.MLSD);
var supportsMachineList = HasFeature(FtpCapability.MLST);

FtpListItem result = null;

Expand Down
4 changes: 2 additions & 2 deletions FluentFTP/Client/BaseClient/Listing.cs
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ protected void CalculateGetListingCommand(string path, FtpListOption options, ou
}
else {
// use machine listing if supported by the server
if (!isForceList && Config.ListingParser == FtpParser.Machine && HasFeature(FtpCapability.MLSD)) {
if (!isForceList && Config.ListingParser == FtpParser.Machine && HasFeature(FtpCapability.MLST)) {
listcmd = "MLSD";
machineList = true;
}
Expand Down Expand Up @@ -164,7 +164,7 @@ protected bool IsServerSideRecursionSupported(FtpListOption options) {
if (!isUseStat) {

// if not using machine listing (MSLD)
if ((!isForceList || Config.ListingParser == FtpParser.Machine) && HasFeature(FtpCapability.MLSD)) {
if ((!isForceList || Config.ListingParser == FtpParser.Machine) && HasFeature(FtpCapability.MLST)) {
}
else {

Expand Down
2 changes: 1 addition & 1 deletion FluentFTP/Client/Modules/ServerFeatureModule.cs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ public static void Detect(List<FtpCapability> capabilities, ref FtpHashAlgorithm
}

if (featName.StartsWith("MLST") || featName.StartsWith("MLSD")) {
capabilities.AddOnce(FtpCapability.MLSD);
capabilities.AddOnce(FtpCapability.MLST);
}
else if (featName.StartsWith("MDTM")) {
capabilities.AddOnce(FtpCapability.MDTM);
Expand Down
1 change: 1 addition & 0 deletions FluentFTP/Client/Modules/ServerStringModule.cs
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,7 @@ internal static class ServerStringModule {
"LIST",
"NLST",
"MLSD",
"MLST",
"STOR",
"STOU",
"APPE",
Expand Down
2 changes: 1 addition & 1 deletion FluentFTP/Client/SyncClient/Connect.cs
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@ public virtual void Connect(bool reConnect) {
// FIX : #739 prefer using machine listings to fix issues with GetListing and DeleteDirectory
if (Config.ListingParser != FtpParser.Custom) {
Config.ListingParser = ServerHandler != null ? ServerHandler.GetParser() : FtpParser.Auto;
if (HasFeature(FtpCapability.MLSD)) {
if (HasFeature(FtpCapability.MLST)) {
Config.ListingParser = FtpParser.Machine;
}
}
Expand Down
2 changes: 1 addition & 1 deletion FluentFTP/Client/SyncClient/GetObjectInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ public FtpListItem GetObjectInfo(string path, bool dateModified = false) {

FtpReply reply;

var supportsMachineList = HasFeature(FtpCapability.MLSD);
var supportsMachineList = HasFeature(FtpCapability.MLST);

FtpListItem result = null;

Expand Down
2 changes: 1 addition & 1 deletion FluentFTP/Enums/FtpCapability.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ public enum FtpCapability : int {
/// <summary>
/// Supports the MLST command (machine listings)
/// </summary>
MLSD = 2,
MLST = 2,

/// <summary>
/// Supports the SIZE command (get file size)
Expand Down
10 changes: 5 additions & 5 deletions FluentFTP/Enums/FtpListOption.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,15 @@ public enum FtpListOption {
/// <summary>
/// Load the modify date using MDTM when it could not
/// be parsed from the server listing. This only pertains
/// to servers that do not implement the MLSD command.
/// to servers that do not implement the MLST command.
/// </summary>
Modify = 1,

/// <summary>
/// Load the file size using the SIZE command when it
/// could not be parsed from the server listing. This
/// only pertains to servers that do not support the
/// MLSD command.
/// MLST command.
/// </summary>
Size = 2,

Expand All @@ -34,18 +34,18 @@ public enum FtpListOption {

/// <summary>
/// Show hidden/dot files. This only pertains to servers
/// that do not support the MLSD command. This option
/// that do not support the MLST command. This option
/// makes use the non standard -a parameter to LIST to
/// tell the server to show hidden files. Since it's a
/// non-standard option it may not always work. MLSD listings
/// non-standard option it may not always work. MLST listings
/// have no such option and whether or not a hidden file is
/// shown is at the discretion of the server.
/// </summary>
AllFiles = 4,

/// <summary>
/// Force the use of OS-specific listings (LIST command) even if
/// machine listings (MLSD command) are supported by the server
/// machine listings (MLST command) are supported by the server
/// </summary>
ForceList = 8,

Expand Down
2 changes: 1 addition & 1 deletion FluentFTP/Helpers/FtpListParser.cs
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,7 @@ private bool IsWrongParser() {
}

private bool IsWrongMachineListing() {
return CurrentParser == FtpParser.Machine && client != null && !client.HasFeature(FtpCapability.MLSD);
return CurrentParser == FtpParser.Machine && client != null && !client.HasFeature(FtpCapability.MLST);
}

/// <summary>
Expand Down