Greg Willits wrote:
> It seems though that any hole in the file must be written to. Otherwise 
> the file format itself must keep track of every byte that it has written 
> to or not in order to have a write-nothing / read-as-zero capability. 

Unless you seek over entire blocks, in which case the filesystem can 
create a "sparse" file with entirely missing blocks (i.e. the disk usage 
reported by du can be much less than the file size)

When you read any of these blocks, you will see all zero bytes.

> Hmm... duh, I can bust out the hex editor and have a look.
> 
> <pause>
> 
> OK, well, empty bytes created by extending the filesize of a new file 
> are 0.chr not an ASCII zero character (well, at least according to the 
> hex editor app). That could simply be the absence of data from virgin 
> disk space. I suppose, that absence of data could be interpreted however 
> the app wants, so the hex editor says it is 0.chr and the POSIX code 
> says it is 48.chr.

No, POSIX says it is a zero byte (character \0, \x00, byte value 0, 
binary 00000000, ASCII NUL, however you want to think of it)
-- 
Posted via http://www.ruby-forum.com/.