Post a reply

Before posting, please read how to report bug or request support effectively.

Bug reports without an attached log file are usually useless.

Options
Add an Attachment

If you do not want to add an Attachment to your Post, please leave the Fields blank.

(maximum 10 MB; please compress large files; only common media, archive, text and programming file formats are allowed)

Options

Topic review

martin

Re: Are any of the directory listing solutions available in .NET/c# assembly?

@will.waterston: Make it working in GUI.
Once you do, have the GUI generate a code template for you:
https://winscp.net/eng/docs/ui_generateurl#code
will.waterston@...

Are any of the directory listing solutions available in .NET/C# assembly?

The Linux device I'm trying to synchronise files to (using session.SynchronizeDirectories()) does not include either owner or group in the default directory listing (ls -al). I cannot make environment changes to this device, nor can I use SFTP/FTP. There are suggestions here to modify the directory listing command using sed or something similar, but I can't see how to do this using the .NET assembly. The SessionOptions class does not seem to include these options.

Any suggestions on how to get around this?

Thanks
knerzelman

It is caused by group name and byte length as one string

I'd say WinSCP expects a BLANK between the group and byte entry.

Bad example:
-rw-rw-rw-    1 admin    administ5572351239 Jan  2 20:39 Movie.mkv

An alias of ls to ls -lh should solve the issue as bytes are then converted to human readable.

Good example:
-rw-rw-rw-    1 admin    administ     5.2G Jan  2 20:39 Movie.mkv
martin

Solution

For list of reasons WinSCP cannot parse directory listing and possible resolutions, see documentation.
Guest

Re: Unexpected directory listing line

@hansfn: This worked for me, I deselected Clear aliases, selected Alias ls to display group name, and forced bash shell, and now it works great :)
martin

Re: What shell?

@jarino: Some general notes:
  • .bashrc might not be invoked for WinSCP session. And naturally if you set "Clear aliases" it cannot work.
  • Have you tried "Alias LS to display group name" option on Shell tab?
jarino

What shell?

Okay, I have looked at the hints here and I get the general thing to do. My question is then "what sort of shell does WinSCP activate?". I have put aliases in my .bashrc and .cshrc (which seems to be the default shell on my system), something like
alias ls='ls -g' (for bashrc).

So now when I ssh to my lab and do a ls -l, I get:
drwx------   9 arino    math         1024 Jan 14 18:35 .

But in the WinSCP log window, I see
drwx------   9 arino        1024 Jan 14 18:35 .

So why is my group is missing? I have specified to use bash, I've tried clearing up the aliases, setting them, forcing LS, not forcing it, etc.
hansfn

Re: Unexpected directory listing line

To me this behaviour seems like a very bad feature. On our system all users have group set to user name which WinSCP doesn't accept. Since our sysadmin hasn't defined any groups this make WinSCP unusable for me...

Regards, Hans - hansfn@gexcon.com

Edit: Forget all about this – I misunderstood. The solution for me was to force WinSCP to use bash in stead of my default tcsh shell.
Guest

Re: Unexpected directory listing line

Seems to expect a group whatever...
Solution is to always use a group name.

Thanks
jono
martin

Re: Unexpected directory listing line

jono wrote:

Error listing directory "/mnt/data".
Unexpected directory listing line "drwxr-xr-x 2 root 12288 Oct 25 16:06 NickPAYEbup".

WinSCP expects group name in directory listing. Have you tried to check option "Alias LS to display group name" on "Shell" tab of Login dialog?
If it does not work, make proper settings on your server to force LS to display group name.
jono

Unexpected directory listing line

I'm getting some odd error messages:
Error listing directory "/mnt/data".
Unexpected directory listing line "drwxr-xr-x 2 root 12288 Oct 25 16:06 NickPAYEbup".
Operation aborted

is typical.. Any ideas?

jono