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: FileExists says file exists even when it does not

Anonymous wrote:

In addition, GetFileInfo is returning invalid information even when the file exists. I wanted to check for a length of 0 but even files that exist have a length of 0 according to GetFileInfo. Clearly, the server is returning invalid information, but the question remains, Why?

No idea. What is your server? I didn't checked before removing the log file.
Guest

Re: FileExists says file exists even when it does not

In addition, GetFileInfo is returning invalid information even when the file exists. I wanted to check for a length of 0 but even files that exist have a length of 0 according to GetFileInfo. Clearly, the server is returning invalid information, but the question remains, Why?

Thanks,

Karen Healey
Guest

Re: FileExists says file exists even when it does not

Why would the server say that a file exists when it doesn't? Is this possibly a response from a non-Windows server?

Thanks,

Karen Healey
Guest

Re: FileExists says file exists even when it does not

Oh.. thanks! The file definitely does not exist because I was deliberately testing that scenario. I'm not sure why the server is reporting that it does exist. That is very strange.

I'll find a work around.

Thank you,

Karen Healey
martin

Re: FileExists says file exists even when it does not

As you can see in the log, your server provides information (possibly fake) for the file /infiles/dhcdheat/export20141103.txt as if it existed.

> 2014-11-03 16:25:43.869 Script: stat -- "/infiles/dhcdheat/export20141103.txt"
. 2014-11-03 16:25:43.869 Listing file "/infiles/dhcdheat/export20141103.txt".
> 2014-11-03 16:25:43.869 Type: SSH_FXP_LSTAT, Size: 45, Number: 263
< 2014-11-03 16:25:43.884 Type: SSH_FXP_ATTRS, Size: 13, Number: 263
. 2014-11-03 16:25:43.884 export20141103.txt;-;0;1899-12-30T05:00:00.000Z;"" [0];"" [0];r-xr-xr-x;0
< 2014-11-03 16:25:43.884 Script: -r-xr-xr-x 0 0 Dec 30 0:00:00 1899 export20141103.txt


If the file does not exist, it's a server-side bug.
Karen Healey

FileExists says file exists even when it does not

I am using the latest WinSCP, just downloaded today on Windows 7. I copied your VB example

https://winscp.net/eng/docs/library_session_getfiles#example

The line : If mySession.FileExists(remotePath) Then

always returns true, even though the file does not exist. Then, it "gets" an empty file. Session log is attached.

What am I doing wrong?

Thank you,

Karen Healey