Just to state the obvious: You can't have anything 'watch' your file unless you have higher level system access, such as access to cron. If your script is the only thing writing to the file, that shouldn't matter, and Daisho's suggestion will do fine.
Shawn
bastil
1:24 pm on May 9, 2003 (gmt 0)
sorry, really forgot to tell what language i need :) i make all my scripts in perl. I would enter the code in another script which writes the file. So everytime it wants to write into file it would check the size before and delete it, if its getting to big
bastil
1:25 pm on May 9, 2003 (gmt 0)
thx daisho for the code
lorax
2:18 pm on May 9, 2003 (gmt 0)
Ah. PERL - well you'll need to wait for a PERL expert - which I am not. Sorry.
ShawnR
10:20 pm on May 9, 2003 (gmt 0)
Not a perl expert either, but here is how:
$filename='/blah/blah/testfile.txt';
$maxsize=102400;
if ( -s $filename > $maxsize ) { unlink($filename); }