Article View: comp.os.os2.programmer.misc
Article #232Named Pipes DOS Access Question
From: Keith R. Bennett
Date: Thu, 14 Oct 1993 18:34
Date: Thu, 14 Oct 1993 18:34
27 lines
1917 bytes
1917 bytes
I am creating a named pipe in a full screen OS/2 session. In a DOS session, I'm fopen'ing the named pipe and fread'ing from it. The writing (OS/2) process writes 100 strings to the pipe in a fast loop. The reading (DOS) process reads from the pipe, also in a fast loop. I have specified the NP_WAIT flag when creating the pipe. My problem is this: after reading some strings from the pipe correctly, the fread() of the DOS process returns 0, indicating that it failed to read anything from the pipe. Why is this? Is the DOS process reading faster than the OS/2 process is writing? I would like the fread() to be blocking, and that's why I used NP_WAIT. Does this parameter work only in OS/2 sessions? What is the best way to deal with this situation? Do I have to loop until the fread returns something? Is there any kind of DosSleep() I can use in a DOS session? Thanks for any help. -- -------------------------------------------------------------------------- Keith Bennett Bennett Business Solutions, Inc. C++/C Software Development 1605 Ingram Terrace kbennett@access.digex.net Silver Spring, MD USA 20906-5932
Technical Details
Message-ID:
<29k648$ipc@access.digex.net>Path:
arc1-ca.pugleaf.net!gmd.de!xlink.net!howland.reston.ans.net!europa.eng.gtefsd.com!uunet!digex.net!digex.net!not-for-mailShow Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 10cd94,78347157620d8aa,start X-Google-Attributes: gid10cd94,public X-Google-Thread: 11307a,78347157620d8aa,start X-Google-Attributes: gid11307a,public X-Google-ArrivalTime: 1993-10-14 12:07:58 PST Path: arc1-ca.pugleaf.net!gmd.de!xlink.net!howland.reston.ans.net!europa.eng.gtefsd.com!uunet!digex.net!digex.net!not-for-mail From: kbennett@access.digex.net (Keith R. Bennett) Newsgroups: comp.os.os2.programmer.misc,bit.listserv.os2-l Subject: Named Pipes DOS Access Question Date: 14 Oct 1993 14:34:48 -0400 Organization: Express Access Online Communications USA Lines: 27 Message-ID: <29k648$ipc@access.digex.net> NNTP-Posting-Host: access.digex.net