🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.windows.ms.programmer
Article #3195

Re: Stream I/O in Windows

#3195
From: CADSI
Date: Tue, 11 Jun 1991 21:01
27 lines
1706 bytes
From article <1991Jun11.190819.13143@iti.org>, by kam@iti.org (Keith A. McNabb):
> 
> Has anyone found a way to use or emulate the C run-time stream I/O
> functions, particularly fscanf().  Microsoft documentation suggests
> using only the low-level read() and write() functions.  That's a lot of
> bother if you're adapting existing code, as fscanf advances the file
> pointer and recognizes EOF, something sscanf() doesn't do.
> 
> Obviously, one could make up a "fake" fscanf based on the size of 
> the file and all.  I'm just trying to make sure I'm not re-inventing
> the wheel here.
> 
> Any suggestions appreciated.

If you really wanna use fscanf and whatnot, just open() the file
and call fdopen() on that file descriptor.  This works, I've done it.
fwrite, fprintf and all the others work after that too.

Next, just to show you what Windows forgot, try a write to file descriptor 0.

Works.  heh, heh.

|----------------------------------------------------------------------------|
|Tom Hite					|  The views expressed by me |
|Manager, Product development			|  are mine, not necessarily |
|CADSI (Computer Aided Design Software Inc.	|  the views of CADSI.       |
|----------------------------------------------------------------------------|
Technical Details
Message-ID: <1991Jun11.210155.3401@ccad.uiowa.edu>
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!uunet!ns-mx!ccad.uiowa.edu!cadsi
References: <1991Jun11.190819.13143@iti.org>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!uunet!ns-mx!ccad.uiowa.edu!cadsi
From: cadsi@ccad.uiowa.edu (CADSI)
Newsgroups: comp.windows.ms.programmer
Subject: Re: Stream I/O in Windows
Message-ID: <1991Jun11.210155.3401@ccad.uiowa.edu>
Date: 11 Jun 91 21:01:55 GMT
References: <1991Jun11.190819.13143@iti.org>
Distribution: na
Organization: CAD-Research, U. of Iowa, Iowa City, Iowa
Lines: 27