Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Using Yesterdays Date as a folder Name

Status
Not open for further replies.

RF101

Technical User
May 17, 2006
33
US

Hello,

I am new to Aspect and I am trying to figure out how to access a folder with yesterdays date as a name. A new folder is ccreated automatically everyday with the format of 20060515.

I saw this thread (thread448-1027713) that shows how to set the date but I do not know how to reference this in the script like below.

waitfor "ftp> "
transmit "cd sDate^M" (This does not work)
waitfor "ftp> "
transmit "mgets^ *.*^M"

TIA, RF101
 
Below is a script that gets the previous day's folder:

proc main
integer iDay, iMonth, iYear, iHour, iMin, iSec
long lOneDayBack
string sFolderName

lOneDayBack = $LTIME - 86400
ltimeints lOneDayBack iYear iMonth iDay iHour iMin iSec

strfmt sFolderName "%d%02d%02d" iYear iMonth iDay
endproc

 

Thanks, but how would I call sFolderName in the script?

In my code I am changing into the directory

waitfor "ftp> "
transmit "cd sFolderName^M" (This does not work)
waitfor "ftp> "
transmit "mgets^ *.*^M"

Is there some syntax I am missing to call sFolderName?
 
I Telnet into 1 box and then I FTP to a second. The folders I need are on the server I FTP into.
 
OK, in that case you would use something like this:

strfmt sFolderName "cd %d%02d%02d^M" iYear iMonth iDay
transmit sFolderName

(replace the original strfmt command in my post with the above two lines)

The first line will create the full command line you need to send, while the second line transmits that command line to the FTP session.

 
Excellent, that did the trick. Thank you very much
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top