Re: Recursive proc/check file size



Ralf Fassel wrote:
* Neil Madden <nem@xxxxxxxxxxxxx>
| proc checksize {myfile {prevsize 0}} {
| set filesize [file size $myfile]
| puts $filesize
| if {$filesize > 0 && $filesize == $prevsize} {
| puts "all done"

On a loaded machine, or due to flushing behaviour, the 'all done'
might not be true.

Yes, that's true - I didn't give much consideration to the actual problem being solved here. The safest solution is to know ahead of time what the final expected size of the file is. With a large enough after interval the above proc will probably be reasonably reliable for casual usage.

-- Neil
.



Relevant Pages