Post a reply

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)


Topic review


Re: mkdir error if already exists

It worked for me.
Really good solution!!!

Hi again prikryl,

Thank you very much!

Best regards,

João Silva

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
# Exit WinSCP
#--> EOF This script was created by SQL <--#

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

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

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

Best regards,

João Silva