From: Greg Willits Date: 2009-07-06T08:36:36+09:00 Subject: Re: file.seek and unused bytes Gary Wright wrote: > On Jul 5, 2009, at 6:13 PM, Greg Willits wrote: >> >> Generally, I wouldn't read in the holes, but I have this one little >> step >> that does end up with some holes, and I know it. What I don't know is >> what to expect in those holes. Null values or, garbage "A' characters >> left over from file X. > > You should expect null bytes (at least on Posix-like file systems). > I'm not sure why you are doubting this. I wasn't separating the read from the write. The spec talks about reading zeros but doesn't talk about writing them. I wasn't trusting that the nulls were getting written. I think I get it now that the read is what matters. Whether a null/zero got written, or whether the gaps are accounted for in some other way, is independent of the data the read returns. I still don't see where the nulls come from (if they're not being written), but if the rules allow me to expect nulls/zeros, and those gaps are being accounted for somewhere/somehow then that's what matters. -- gw -- Posted via http://www.ruby-forum.com/.