GETLIST remote_dir extra characters
3 posts
• Page 1 of 1
GETLIST remote_dir extra characters
Hi,
I am a first time user of ScritpFTP....this is great....everything I need to make me feel like a real programmer, but....!
Below is the script I have created to identify if a directory exists with todays date ie 20111108 if not create it....
However the script returns...
The GETLIST commend is putting a leading character and it therefore does not match the "$currentdate".
What can I do to fix this...
Also is there a way of changing the date format to DDMMYYYY.
Thanks
Mark....
I am a first time user of ScritpFTP....this is great....everything I need to make me feel like a real programmer, but....!
Below is the script I have created to identify if a directory exists with todays date ie 20111108 if not create it....
#Check to see if directory with todays date exists if not create it
GETLIST($checkdir,REMOTE_DIRECTORIES,$currentdate)
PRINT($checkdir)
PRINT($currentdate)
# problem with returned directory list - leading character
IF($checkdir!="$currentdate")
# Create directory with current date
MKDIR($currentdate)
END IF
GETLIST($checkdir,REMOTE_DIRECTORIES,$currentdate)
PRINT($checkdir)
PRINT($currentdate)
# problem with returned directory list - leading character
IF($checkdir!="$currentdate")
# Create directory with current date
MKDIR($currentdate)
END IF
However the script returns...
GETLIST(REMOTE_DIRECTORIES,"20111108")
Getting directory listing of current remote directory
Found 1 directory.
|20111108
20111108
The GETLIST commend is putting a leading character and it therefore does not match the "$currentdate".
What can I do to fix this...
Also is there a way of changing the date format to DDMMYYYY.
Thanks
Mark....
- mark911mcc
- Posts: 4
- Joined: 08 Nov 2011, 08:56
Re: GETLIST remote_dir extra characters
Hello,
Welcome to the forum. You can try putting "|" before the date:
But a better (and cleaner) way to see if the directory actually exists or not is:
Welcome to the forum. You can try putting "|" before the date:
But a better (and cleaner) way to see if the directory actually exists or not is:
- ScriptFTP support
- Site Admin
- Posts: 624
- Joined: 04 Aug 2008, 15:08
- Location: Burgos, Spain, EU
Re: GETLIST remote_dir extra characters
Thanks, I went with option A putting "|" in front. Because we are using the filetr option in the GETLIST and not using the rest of the directory listing it seams to be a much simpler fix.
Cheers
Mark....
Cheers
Mark....
- mark911mcc
- Posts: 4
- Joined: 08 Nov 2011, 08:56
3 posts
• Page 1 of 1
Who is online
Users browsing this forum: No registered users and 1 guest

