mkdir error if already exists

Advertisement

JohnZT
Guest

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:
&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;
&lt;session xmlns=&quot;http&#58;//beta.winscp.net/schema/session/1.0&quot; name=&quot;blabla&quot; start=&quot;2015-09-08T13&#58;20&#58;24.578Z&quot;&gt;
&nbsp; &lt;failure&gt;
&nbsp; &nbsp; &lt;message&gt;Error creating folder '201508'.&lt;/message&gt;
&nbsp; &nbsp; &lt;message&gt;201508&#58; File exists.&lt;/message&gt;
&nbsp; &lt;/failure&gt;
&nbsp; &lt;mkdir&gt;
&nbsp; &nbsp; &lt;filename value=&quot;/xxx/extract//201508&quot; /&gt;
&nbsp; &nbsp; &lt;result success=&quot;false&quot;&gt;
&nbsp; &nbsp; &nbsp; &lt;message&gt;201508&#58; File exists.&lt;/message&gt;
&nbsp; &nbsp; &lt;/result&gt;
&nbsp; &lt;/mkdir&gt;
&lt;/session&gt;

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

Best regards,

João Silva

Reply with quote

Advertisement

Advertisement

You can post new topics in this forum