mIRC Homepage
Posted By: Netchelandorious fopen and $file().size - 18/11/03 02:16 AM
$file().size doesn't seem to report the correct file size while a process is running that may change the file size unless the file is closed first.

//fopen -on test test.txt | echo -a $file(test.txt).size | fwrite -n test this is a test | echo -a $file(test.txt).size | fwrite -n test this is another test | echo -a $file(test.txt).size | fclose test | echo -a $file(test.txt).size

it's fine with me if $file().size is out of synch with files opened using fopen during a process, it would be nice though to have $fopen().fsize since that would likely be faster anyways.

In the mean-time....
fseek test 81203948074523
%filesize = $fopen(test).pos
Posted By: Netchelandorious Re: fopen and $file().size - 18/11/03 02:23 AM
oops, I was wrong...
fseek test 81203948074523
$fopen(test).pos = 81203948074523
--- edit ---
Also, apparently $fopen().eof is 0 (false) if you fseek past the end of the file.
© mIRC Discussion Forums