From 8ce87a3cfc0626b00f396aa699ef948a8d919c17 Mon Sep 17 00:00:00 2001 From: Eveldee Date: Wed, 17 Jul 2019 23:54:05 +0200 Subject: [PATCH] Fix style issue Now use deconstructor --- DearFTP/Connection/Commands/MakeDirectoryCommand.cs | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/DearFTP/Connection/Commands/MakeDirectoryCommand.cs b/DearFTP/Connection/Commands/MakeDirectoryCommand.cs index 59877a4..257d53a 100644 --- a/DearFTP/Connection/Commands/MakeDirectoryCommand.cs +++ b/DearFTP/Connection/Commands/MakeDirectoryCommand.cs @@ -22,33 +22,33 @@ namespace DearFTP.Connection.Commands return; } - var newDirectory = session.NavigablePath.GetNewSystemFilePath(argument); + var (navigablePath, realPath) = session.NavigablePath.GetNewSystemFilePath(argument); - if (newDirectory.navigablePath.CurrentDirectory == "/") + if (navigablePath.CurrentDirectory == "/") { stream.Send(ResponseCode.FileUnavailable, "Can't modify the root."); return; } - if (newDirectory.realPath == null) + if (realPath == null) { stream.Send(ResponseCode.FileUnavailable, "Invalid destination path."); return; } - if (File.Exists(newDirectory.realPath) || Directory.Exists(newDirectory.realPath)) + if (File.Exists(realPath) || Directory.Exists(realPath)) { stream.Send(ResponseCode.FileUnavailable, "Destination path already exists."); return; } - if (!session.WritablesShares.Contains(newDirectory.navigablePath.CurrentShare)) + if (!session.WritablesShares.Contains(navigablePath.CurrentShare)) { stream.Send(ResponseCode.FileUnavailable, "You don't have write access to this file."); return; } - Directory.CreateDirectory(newDirectory.realPath); + Directory.CreateDirectory(realPath); stream.Send(ResponseCode.FileActionOK, "Directory successfully created."); }