Topic "Delete only files - not the source folder"

Author Message
Theme81
[View user's profile]

Joined: 2012-03-06
Posts: 1
I'm having a trouble when using WinSCP from .NET Code.
The delete handle in get command deletes the source files but tries also to remove the source directory which gives me error in my log.xml file

Code:
  <rm>
    <filename value="/myremotepath" />
    <result success="false">
      <message>Permission denied.
Error code: 3
Error message from server: Permission denied
Request code: 15</message>
    </result>
  </rm>


I'm trying to simply get all jpg files from one folder and delete them.

filemask="*/; *.jpg"
get /myremotepath /mylocalpath -delete

Thanks in advance!
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 25015
Location: Prague, Czechia
If you want to keep the source directory, make sure you are downloading its content, not the directory itself:
get /myremotepath/* /mylocalpath/ -delete
Advertisements

You can post new topics in this forum






Search Site

What is WinSCP?

It is award-winning SFTP client, SCP client, FTPS client and FTP client integrated into one software program for file transfer to FTP server or secure SFTP server. [More]

And it's free!

Donate

About donations

$9   $19   $49   $99

About donations

Recommend

WinSCP Privacy Policy

WinSCP License