I assume that the date stamp on a print file will be the date/time it was originally written to disk until another application opens it. Once this happens then the modified date/time will change.
Not sure whether it would work but have you tried checking for an OPEN file? You could run a test on the file to see if it is locked or open for write by another application and only access it yourself once the ‘print’ process has completed.
I’m on unix which unlike Windows doesn’t have file locking. This is why I need to check over a period of time to see that it hasn’t been updated. My question was about why the ‘after’ command didn’t appear to execute.
You need to have the after command on a line by itself. The way you are writing it, tcl thinks that you want that script to execute after 30000msec. The first form of after is what you want in this case which is after .
Try this:
set i 0
file stat $fname1 fstat1
while {$i<5} {
incr i
after 30000
file stat $fname1 fstat2
if {$fstat1(mtime) == $fstat2(mtime)} {
file copy $fname1 $fname2
break
} else {
file stat $fname1 fstat1
}
}
Cheers
John Mercogliano
Sentara Healthcare
Hampton Roads, VA