OK thanks anon that's not a bad way to find the size. But is there any better algorithm? I don't know I feel mine is very cheap if you know what I mean.
There is nothing expensive about seeking to the end of a file. it is also the only portable way to solve your problem.