I am trying to delete a file after checking for existance, Below is the code:
```
using (SftpClient sftp = new SftpClient(hostName, portNumber, userName, passWord))
{
sftp.Connect();
if(sftp.Exists(remotePath))
sftp.Delete(remotePath);
}
```
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).
Thanx.
Comments: ** Comment from web user: ryanmurakami **
```
using (SftpClient sftp = new SftpClient(hostName, portNumber, userName, passWord))
{
sftp.Connect();
if(sftp.Exists(remotePath))
sftp.Delete(remotePath);
}
```
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).
Thanx.
Comments: ** Comment from web user: ryanmurakami **
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!