public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
* Reading a ^Z
@ 1997-09-02 22:32 Ian Collins
  1997-09-04 21:18 ` Mikey
  0 siblings, 1 reply; 2+ messages in thread
From: Ian Collins @ 1997-09-02 22:32 UTC (permalink / raw)
  To: 'Gnu win32 mailer'

Please help someone!

I am sure this has come up before (probably before I joined).
I am reading a binary file. The file is fopened with O_RDONLY.
When doing the read, I am using,

n = fread((void *) buffer, (size_t) sizeof(char), (size_t)
numrecs*reclen, ifd);

where numrecs and reclen are the number of records in the file each of
length reclen.

If there is a control-Z (^Z) in the file, the fread will read up to the
^Z and the rest of the buffer is filled with NULLS.
Now I know, in the distant past, DOS files were terminated by a ^Z, but
surely there is a workaround to this.
I am using b18 with Sergeys latest cygwin.dll.
-
For help on using this list (especially unsubscribing), send a message to
"gnu-win32-request@cygnus.com" with one line of text: "help".

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~1997-09-04 21:18 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1997-09-02 22:32 Reading a ^Z Ian Collins
1997-09-04 21:18 ` Mikey

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).