It's almost always wrong to assume the apparent file size is the same number of
bytes read will return. It doesn't deal with files being extended while you
change them, for one thing, or for files in /proc which have no particular
length until you start reading them.
> What's the reason for device specials not to report their sizes?
Most devices these days have sizes which can't be expressed through the VFS
layer. File sizes are still limited to 2^31 bytes, and when was the last time
you saw a new 2G disk? Internally the kernel expresses device sizes in blocks,
so it has a limit of 2^40 bytes for devices with 512 byte blocks. When we get
64bit file sizes it should be possible to do something like you ask.
J
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/