read(), write() and ftell(), feof()

Todd Waxahachiefortudinouslyexportitionismistically Hartman thartman@austin.ibm.com
Thu Jul 9 13:22:00 GMT 1998


> Under win32 (nad also linux) when reading/writing to a file using
> read()/write() does not update the file pointer information so that functions
> like ftell() and feof() do not work properly. These functions do update the
> file pointers properly under Solaris and Unixware. What gives?
> 
> David Chazin

Is this behavior guaranteed under POSIX?  Why are you using read()/write()?
I don't think you can mix buffered and unbuffered I/O and expect things
to function properly.  If you don't want to use fread()/fwrite() with
streams, than you probably should forget about using the other functions
and macros that deal with the stream structure (FILE).


todd.

-- 
Todd Hartman           thartman@austin.ibm.com      (512)838-8789
The opinions which may or may not be explicitly expressed or implied in this
document are completely my own and are not necessarily those of my employer.
-
For help on using this list (especially unsubscribing), send a message to
"gnu-win32-request@cygnus.com" with one line of text: "help".



More information about the Cygwin mailing list