.Net Library Remove Files

Advertisement

gcrawfo
Joined:
Posts:
1
Location:
Maryland

.Net Library Remove Files

I am running WinSCP 5.1.3 (build 2881). I am using the .Net library and writing a C# console application. I am connecting with SFTP-3 protocol.

My program is retrieving all the files (based on fileMask) in a remote directory. I don't want to get the files a second time, so I would like to delete the files after I successfully download them.

I have tried setting the Session.RemoveRemoteFiles parameter to true and have tried explicitly calling the Session.RemoveFiles method and passing a full path, including a specific file name. If the file being removed is the last file in the remote directory, WinSCP also removes the directory. Is this expected behavior? If so, it there a way to delete the last file in a remote directory, without removing the remote directory?

Thanks,
gary

Reply with quote

Advertisement

martin
Site Admin
martin avatar
Joined:
Posts:
40,476
Location:
Prague, Czechia

Re: .Net Library Remove Files

Session.RemoveFiles should not remove the directory with the last file.
Please attach your code along with complete session log file (Session.SessionLogPath).

Reply with quote

Advertisement

You can post new topics in this forum