[lkml]   [1998]   [Nov]   [28]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
SubjectRE: /dev/winchester reporting their size

On 27-Nov-98 Johnny Tevessen wrote:
> Would it be possible (by definition) to have /dev/hdX* and /dev/sdX*
> (sdX not tested) to report their *real* size as file sizes?
> I have an application (UAE, should be well-known) which works perfectly
> if I copy /dev/hd.. to a file first, but doesn't work with 0 byte "files".

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.


To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to
Please read the FAQ at

 \ /
  Last update: 2005-03-22 13:45    [W:0.048 / U:8.948 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site