Post a reply

Options
Add an Attachment

If you do not want to add an Attachment to your Post, please leave the Fields blank.

(maximum 10 MB; please compress large files; only common media, archive, text and programming file formats are allowed)

Options

Topic review

Guest

Re: mkdir error if already exists

It worked for me.
Really good solution!!!
Guest

Hi again prikryl,

Thank you very much!

Best regards,

João Silva
JohnZT

mkdir error if already exists

Hi prikryl,

I am using winSCP version (5.5.6) in scripting form.
Here is my script:
#--> This script was created by SQL <--#

# Automatically abort script on errors
option batch abort
# Disable overwrite confirmations that conflict with the previous
option confirm off
# Connect
open ftp://blablabla/
# Command Line
cd /xxx/extract/
mkdir 201508
cd 201508
rm "XXX_201508*.zip"
put "\\blabla\201508\XXX_201508*.zip"
# Disconnect
close
# Exit WinSCP
exit
#--> EOF This script was created by SQL <--#


And this is my xmllog:
<?xml version="1.0" encoding="UTF-8"?>

<session xmlns="http://winscp.net/schema/session/1.0" name="blabla" start="2015-09-08T13:20:24.578Z">
  <failure>
    <message>Error creating folder '201508'.</message>
    <message>201508: File exists.</message>
  </failure>
  <mkdir>
    <filename value="/xxx/extract//201508" />
    <result success="false">
      <message>201508: File exists.</message>
    </result>
  </mkdir>
</session>


Is there any way I confirm if the folder already exists and bypass mkdir step?

Best regards,

João Silva