Re: eof/file-size consistency semantics

John May (johnmay@llnl.gov)
Mon, 21 Apr 1997 18:01:53 -0700

Ian E. Stockdale writes:
> >> \const{MPI\_SEEK\_END}:
> >> the pointer is set to the end of file plus \mpiarg{offset}
>
> John May asked:
> >Assuming that the size is independent of the view, what happens
> >if EOF falls on a hole?
>
> I believe that the file would look like:
> ( '-' = hole, 'd' = data, 'E' = EOF, x = file pointer )
>
> dddddddd--------E-----
> x
>
> if offset is positive and
>
> dddddddd--------E
> x
>
> if offset is negative.

So seeking with MPI_SEEK_END can drop you into the middle of
a hole? And presumably the next read or write would access
that spot?

That doesn't seem very useful or intuitive.

If the choice is between and easy-to-write definition that
gives you this behavior and a hard-to-write (or hard-to-
read) definition that keeps you aligned with your filetype,
I'd definitely choose the latter.

John