mIRC Home    About    Download    Register    News    Help

Print Thread
fopen and $file().size #60878 18/11/03 02:16 AM
Joined: Dec 2002
Posts: 31
N
Netchelandorious Offline OP
Ameglian cow
OP Offline
Ameglian cow
N
Joined: Dec 2002
Posts: 31
$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

Re: fopen and $file().size #60879 18/11/03 02:23 AM
Joined: Dec 2002
Posts: 31
N
Netchelandorious Offline OP
Ameglian cow
OP Offline
Ameglian cow
N
Joined: Dec 2002
Posts: 31
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.

Last edited by Netchelandorious; 18/11/03 02:27 AM.