Quantcast
Channel: sshnet Issue Tracker Rss Feed
Viewing all articles
Browse latest Browse all 1026

Commented Issue: SftpClient deletefile/delete fails [1484]

$
0
0
using (SftpClient sftp = new SftpClient(hostName, portNumber, userName, passWord))
{
sftp.Connect();
sftp.Delete(remotePath);
}

Code throws "Permission Denied" error, but i have permission to delete file. I confirmed this using WinSCP both their UI and .NET library (works fine).
Comments: ** Comment from web user: mcpunjabi **

Unfortunately i was busy with work, so sorry for the late reply. I did some more tests and the issues seems to be with sftp.Exists(filename) function. Here is what i am using in my application:

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).


Viewing all articles
Browse latest Browse all 1026

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>