This project is read-only.


SftpClient deletefile/delete fails after Exists check


I am trying to delete a file after checking for existance, Below is the code:
using (SftpClient sftp = new SftpClient(hostName, portNumber, userName, passWord))
Logs show that the Exists command tries to download file and fails and when it gets to the Delete call server throws the "File in Use" error. ( not the "permission denied error" like the exception shows).


file attachments

Closed Feb 3, 2013 at 1:05 AM by olegkap
Ok, good,
Closing it now


olegkap wrote Feb 2, 2013 at 10:41 PM

I could not recreate your problem but I just committed a code where I do exists check a little different without opening a file like I did earlier.
Can you please download it a see if it fixes your problem?


wrote Feb 2, 2013 at 10:41 PM

mcpunjabi wrote Feb 3, 2013 at 12:09 AM

Yes, works fine now. Thanx.

wrote Feb 3, 2013 at 1:05 AM

wrote Feb 22, 2013 at 2:17 AM

wrote May 16, 2013 at 1:14 PM

ryanmurakami wrote Jun 18, 2013 at 6:47 PM

Was this fixed in the binary for all .NET versions, or only the source? Using the 3.5 binary I'm still getting true when asking if a file exists (that is not there). Thanks!