Help Using ExecuteCommand? ls is unrecognized command.

Advertisement

JeffLawlorEtna
Joined:
Posts:
1
Location:
United States

Help Using ExecuteCommand? ls is unrecognized command.

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:

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

Reply with quote

Advertisement

martin
Site Admin
martin avatar
Joined:
Posts:
29,561
Location:
Prague, Czechia

Re: Help Using ExecuteCommand? ls is unrecognized command.

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:
https://winscp.net/eng/docs/library_session_listdirectory
_________________
Martin Prikryl

Reply with quote

Advertisement

You can post new topics in this forum