Wilson WindowWare Tech Support

WinBatch WinBatch+Compiler WebBatch
Home | Tech Database | Tech BBS | White Papers | Purchase


FtpPut using a File Name that Will Change

Keywords:    fileitemize

Question:

I'm trying to do an ftpPut using a file name that will change. Since you can't use wild cards in the ftpPut command, how can this be accomplish?

Example:

File name is XX97243.01 (this file is generated by a another computer that dynamically construct the name from the julian date and a sequence number).

It would be nice if I could do this:

	ftpPut(ftpSession,"c:\mydir\xx*.*","*.*","A")
or this:
	fname = fileItemize("xx*")
	ftpPut(ftpSession,fname,fname,"A")

Any ideas?


Answer:

  1. ASSUMING there is only 1 XX* file in the current directory:
    flist = fileItemize("xx*")
    fname=ItemExtract(1,flist,@tab)
    ftpPut(ftpSession,fname,fname,"A")
    

Article ID:   W12646
Filename:   FtpPut with Local File Name that Changes.txt