I did a short experement with a text file I have, basicaly I told it to print out the size of the file, and then open it, read it and print the length... they didn't match. I'll admit, I'm currently stuck on Win32, but the file was saved in UNIX (I love TextPad). So I don't quite know what to make of that, or did I misunderstand what you were saying?
You did misunderstand, or I was unclear.
First and foremost the size of a file is not
the same as the size of it's contents (especially
on some filesystems). But for all but the strictest
of purposes it's close enough. What I suggested was something like:
#About to append $message, do we have enough room?
if( -s $file + length($message) > $maxSize ){
#do magic here
}
Oh, I think I understand now, basically, it's just a good approximation, not precise. Ok, thanks. I'll see what I can do with the information you guys gave me (including those of you in other sub-threads.)