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!

Select file to send based on Time/Date Stamp 1

Status
Not open for further replies.
Aug 23, 2002
1
US
I am attempting to compile a script that will send one file from a group of files in a directory. The only file that is to be sent is the one created last. All other files need to be deleted. What is the best way to accomplish this task? Thanks!
 
Hello,

Can you Describe the Filename Format ?? Is it Time/Date Based ??

This can be done with few Problems..

Hank
 
Here's a script I whipped up a little earlier tonight. It worked fine with the four or five files I copied to the test directory.

proc main
long lDate = 0
string sFname

if findfirst "c:\windows\temp\test\*.*" "NRHSA"
sFname = $FILESPEC
lDate = $FLTIME
while findnext
if $FLTIME >= lDate
lDate = $FLTIME
delfile sFname
sFname = $FILESPEC
else
delfile $FILESPEC
endif
endwhile
else
usermsg "No files found!"
endif
endproc aspect@aspectscripting.com
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top