private static void DoList(FtpsClient client) { var remoteDirName = _commandArguments.Count > 0 ? NormalizeRemotePath(_commandArguments[0]) : client.GetCurrentDirectory(); Console.WriteLine(); Console.WriteLine("Remote directory: " + remoteDirName); // Get the dirList before the WriteLine in order to avoid writing an empty newline in case of exceptions var dirList = client.GetDirectoryListUnparsed(remoteDirName); Console.WriteLine(); Console.WriteLine(dirList); }