| || |
Deleting the latest file from a list
We have two files by the same name and created on the same date.I want to delete the recent one.Can you suggest a solution for this problem.We are using latest version of Winrunner that is 7.5 version.
Re: Deleting the latest file from a list
Ummm... how do you have 2 files with the same name? (Or are they in different directories?)
In any case, there are probably a number of ways to attack this. You could write some sort of batch or script file to do this, and call it from WR via dos_system() or invoke_application(). You could do a dos_system() command using the DOS 'dir' command with appropriate arguments to sort by date and redirect the output to a file, which you could then read and parse via the WR file_*, match(), index(), and/or substr() functions; then use dos_system() with a 'del' command to delete the desired file. Or you could do something simpler that I have not thought of yet.
"Any sufficiently advanced bug is indistinguishable from a feature." -Bruce Brown
[i]...Sound trumpets! Every trumpet in the host! / Sixty thousand, on these words, sound, so high the mountains sound, and the valleys resound.</i] (The Song of Roland)