Hello,
I have a script that, as it is logging into the far end, prompts the user if they want to start a capture file or not:
set capture overwrite off
set capture query on
set capture file capfile
capture on
It goes on and creates the file name based on the date & time and all. That all works good. The problem I am having is, when it prompts them with the 'Capture File' window, if they click cancel (meaning they don't want to start a capture file), it still creates a file with 0 bytes in the capture directory. In an effort to keep that directory cleaned out, I added a section of script to try to delete that file:
if findfirst capfile1
ifilesize = $FSIZE
itoa ifilesize sfilesize
if strcmp sfilesize zero
delfile capfile1
endif
endif
Basically, if the file size is 0, I want it to delete the file. This sometimes works with no problem, but most of the time doesn't. It is weird, if I sit there and try to play with the script to make it work, and have a window open in the capture directory (so I can sit there and watch the file be created, then watch it be deleted), it seems to work every time. If I don't have that window open, though, it does not work most of the time.
Does anyone have any idea how to make this work every time??
In case you need it, I am using Windows2000 & Procomm 4.8
Any help would be appreciated.
Thanks,
Tim
I have a script that, as it is logging into the far end, prompts the user if they want to start a capture file or not:
set capture overwrite off
set capture query on
set capture file capfile
capture on
It goes on and creates the file name based on the date & time and all. That all works good. The problem I am having is, when it prompts them with the 'Capture File' window, if they click cancel (meaning they don't want to start a capture file), it still creates a file with 0 bytes in the capture directory. In an effort to keep that directory cleaned out, I added a section of script to try to delete that file:
if findfirst capfile1
ifilesize = $FSIZE
itoa ifilesize sfilesize
if strcmp sfilesize zero
delfile capfile1
endif
endif
Basically, if the file size is 0, I want it to delete the file. This sometimes works with no problem, but most of the time doesn't. It is weird, if I sit there and try to play with the script to make it work, and have a window open in the capture directory (so I can sit there and watch the file be created, then watch it be deleted), it seems to work every time. If I don't have that window open, though, it does not work most of the time.
Does anyone have any idea how to make this work every time??
In case you need it, I am using Windows2000 & Procomm 4.8
Any help would be appreciated.
Thanks,
Tim