I've tried to use sftp.Exists(String) do not work for files. Already tested for file and for directory. Directory work well, but files are not recognized.
Comments: ** Comment from web user: oeriksen **
Comments: ** Comment from web user: oeriksen **
I've been looking at this and see that the Exists function was rewritten because it caused a subsequent Delete to fail on some system (file was not closed by the SSH server). The problem is that on some systems RequestRealPath doesn't throw an error. I would guess some (or all) Windows based servers, at least that the case for me. I agree on the current solution, it's much better than a file open and close, but wouldn't it be better to use RequestLStat instead of RequestRealPath? I can't imagine any systems not throwing an error if file or directory doesn't exist when executing that. Or is there any other reason not to use it?