Skip to content

Commit

Permalink
add - doc - Added local/remote mkdir command
Browse files Browse the repository at this point in the history
---

We've added mkldir and mkrdir for local and remote directory creation in
the FTP addon.

---

Type: add
Breaking: False
Doc Required: True
Backport Required: False
Part: 1/1
  • Loading branch information
AptiviCEO committed Jan 21, 2025
1 parent 79c69ca commit cb88909
Show file tree
Hide file tree
Showing 3 changed files with 97 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
//
// Nitrocid KS Copyright (C) 2018-2025 Aptivi
//
// This file is part of Nitrocid KS
//
// Nitrocid KS is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// Nitrocid KS is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY, without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <https://www.gnu.org/licenses/>.
//

using Nitrocid.Files;
using Nitrocid.Shell.ShellBase.Commands;

namespace Nitrocid.Extras.FtpShell.FTP.Commands
{
/// <summary>
/// Makes your local directory
/// </summary>
/// <remarks>
/// This command lets you create your local directory in your connected FTP server.
/// </remarks>
class MkldirCommand : BaseCommand, ICommand
{

public override int Execute(CommandParameters parameters, ref string variableValue)
{
string targetDir = FilesystemTools.NeutralizePath(parameters.ArgumentsList[0], FTPShellCommon.FtpCurrentDirectory);
FilesystemTools.MakeDirectory(targetDir);
return 0;
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
//
// Nitrocid KS Copyright (C) 2018-2025 Aptivi
//
// This file is part of Nitrocid KS
//
// Nitrocid KS is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// Nitrocid KS is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY, without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <https://www.gnu.org/licenses/>.
//

using Nitrocid.Extras.FtpShell.Tools.Filesystem;
using Nitrocid.Shell.ShellBase.Commands;

namespace Nitrocid.Extras.FtpShell.FTP.Commands
{
/// <summary>
/// Makes your remote directory
/// </summary>
/// <remarks>
/// This command lets you create your remote directory in your connected FTP server.
/// </remarks>
class MkrdirCommand : BaseCommand, ICommand
{

public override int Execute(CommandParameters parameters, ref string variableValue)
{
FTPFilesystem.FTPMakeDirectory(parameters.ArgumentsList[0]);
return 0;
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,22 @@ internal class FTPShellInfo : BaseShellInfo, IShellInfo
])
], new LsrCommand(), CommandFlags.Wrappable),

new CommandInfo("mkldir", /* Localizable */ "Creates a local directory",
[
new CommandArgumentInfo(
[
new CommandArgumentPart(true, "directory"),
], true)
], new MkldirCommand()),

new CommandInfo("mkrdir", /* Localizable */ "Creates a remote directory",
[
new CommandArgumentInfo(
[
new CommandArgumentPart(true, "directory"),
], true)
], new MkrdirCommand()),

new CommandInfo("mv", /* Localizable */ "Moves file or directory to another file or directory. You can also use that to rename files.",
[
new CommandArgumentInfo(new[]
Expand Down

0 comments on commit cb88909

Please sign in to comment.