Topic "Help Using ExecuteCommand? ls is unrecognized command."

Author Message
JeffLawlorEtna
[View user's profile]

Joined: 2012-07-17
Posts: 1
Location: United States
Greetings. Thanks for all the effort in creating this library!

I'm trying to run a "ls" command against a plain old FTP server and I get an exception:

Syntax error, command unrecognized.

Here's the code:

Code:
CommandExecutionResult result = _session.ExecuteCommand("ls");


I must be missing something simple here. Any advice?

I'm using the 5.07 beta of WinSCP and the assembly.

Thanks,
Jeff
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 24512
Location: Prague, Czechia
There's no "LS" FTP command.

You probably wanted to use "LIST". But that won't work anyway for numerous reasons. Primary one being that for directory listing with FTP you need to open a separate channel. The listing is not part of a direct response to the LIST command.

Anyway, what's the point? There's Session.ListDirectory command:
http://winscp.net/eng/docs/library_session_listdirectory
_________________
Martin Prikryl
Advertisements

You can post new topics in this forum






Search Site

What is WinSCP?

It is award-winning SFTP client, SCP client, FTPS client and FTP client integrated into one software program for file transfer to FTP server or secure SFTP server. [More]

And it's free!

Donate

About donations

$9   $19   $49   $99

About donations

Recommend

WinSCP Privacy Policy

WinSCP License