Behaviour of mkdir if folder already exists?

Advertisement

LeighWardle
Joined:
Posts:
6

Behaviour of mkdir if folder already exists?

Hi all,

I am using this Script:
open ftp://mincad:redacted.redacted.redacted.redacted -explicitssl -passive=on
mkdir "/root/folder"
cd "/root/folder"
put "c:\localfolder\file.exe" "file.exe"
exit
It works fine when the /root/folder does not exist, but if it does exist, I get a fatal error:
Here is the excerpt from the log:
> 2024-06-03 17:11:04.951 Script: mkdir "/root/folder"
. 2024-06-03 17:11:04.951 Creating directory "/root/folder".
> 2024-06-03 17:11:04.951 CWD /root
< 2024-06-03 17:11:04.966 250 CWD command successful
> 2024-06-03 17:11:04.966 MKD folder
< 2024-06-03 17:11:04.982 550 folder: File exists
. 2024-06-03 17:11:04.982 Asking user:
. 2024-06-03 17:11:04.982 Error creating folder '/root/folder'. ("folder: File exists")
< 2024-06-03 17:11:04.982 Script: Error creating folder '/root/folder'.
< 2024-06-03 17:11:04.982 Script: folder: File exists
. 2024-06-03 17:11:04.982 Answer: Abort
. 2024-06-03 17:11:04.982 Script: Failed
. 2024-06-03 17:11:04.982 Script: Exit code: 1
. 2024-06-03 17:11:04.982 Disconnected from server
Hope it's any easy fix.

Regards,
Leigh

Reply with quote E-mail

Advertisement

LeighWardle
Joined:
Posts:
6

Hi Martin,

One more thing, when mkdir aborted, the log shows the Exit code: 1.
. 2024-06-03 17:11:04.982 Script: Failed
. 2024-06-03 17:11:04.982 Script: Exit code: 1 
But Shell returned the error code = 0.

Is there a fix for this?
Thanks,

Leigh

Reply with quote E-mail

Advertisement

Advertisement

You can post new topics in this forum