Delete only files - not the source folder

Advertisement

Theme81
Joined:
Posts:
1

Delete only files - not the source folder

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

  <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!

Reply with quote

Advertisement

martin
Site Admin
martin avatar
Joined:
Posts:
41,454
Location:
Prague, Czechia

Re: Delete only files - not the source folder

If you want to keep the source directory, make sure you are downloading its content, not the directory itself:
get /myremotepath/* /mylocalpath/ -delete

Reply with quote

Advertisement

You can post new topics in this forum