Hi,
We are trying to move to a remote directory that uses the format...
Invoices_08-11-2011
Actually the format is not that important we can change it but using the date is a requirment. The issue is how do we identify the current date directory. So that we can move into it. I looked at GETFILETIME but this does not work for directories.
Any ideas would be greatly appreciated.
Thanks
Mark....
We are trying to move to a remote directory that uses the format...
Invoices_08-11-2011
Actually the format is not that important we can change it but using the date is a requirment. The issue is how do we identify the current date directory. So that we can move into it. I looked at GETFILETIME but this does not work for directories.
Any ideas would be greatly appreciated.
Thanks
Mark....
Hello Mark,
You need to build manually the directory name corresponding for today. For example:
[scriptftp="today_directory.ftp"]$today_directory_name = "Invoices_".GETTIME(DAY)."-".GETTIME(MONTH)."-".GETTIME(YEAR)
$result=CHDIR($today_directory_name)
IF($result=="OK")
PRINT("Directory for today found")
# Do whatever here like download files, upload new ones etc.
ELSE
PRINT("Directory for today NOT found")
END IF[/ScriptFTP]
You need to build manually the directory name corresponding for today. For example:
[scriptftp="today_directory.ftp"]$today_directory_name = "Invoices_".GETTIME(DAY)."-".GETTIME(MONTH)."-".GETTIME(YEAR)
$result=CHDIR($today_directory_name)
IF($result=="OK")
PRINT("Directory for today found")
# Do whatever here like download files, upload new ones etc.
ELSE
PRINT("Directory for today NOT found")
END IF[/ScriptFTP]
liked Script FTP? Try our other product Email Parser
Thanks that worked a treat....I also set the date as variables as they are used elsewhere in the script.
Cheers
Mark....
Cheers
Mark....