Path: utzoo!utgpu!news-server.csri.toronto.edu!bonnie.concordia.ca!uunet!microsoft!donc From: donc@microsoft.UUCP (Don CORBITT) Newsgroups: comp.windows.ms.programmer Subject: Re: using OpenFile in BC++ (was Re: MS Windows Classes) Message-ID: <72251@microsoft.UUCP> Date: 9 May 91 18:37:59 GMT References: <1991Apr23> <149000023@primerd> <1991Apr30.025244.5815@mnemosyne.cs.du.edu> <1991Apr30.115545.5197@borland.com> Reply-To: donc@microsoft.UUCP (Don CORBITT) Organization: Microsoft Corp., Redmond WA Lines: 38 In article <1991Apr30.115545.5197@borland.com> sidney@borland.com (Sidney Markowitz) writes: [some stuff about OpenFile() not working with BI's read()] >In BC++, the handle that is returned by OpenFile() or _lopen() can be >passed to _lread(), _lwrite() and the other SDK file I/O functions, >but not to read(), write(), and similar RTL file handle I/O functions. true. >The handle that is returned by open() can be used by read(), write(), >etc., but not by _lread(), _lwrite(), etc. false. >The problem is that both OpenFile() and open() use some auxillary data >structures in parallel with the DOS file handles, and OpenFile() is [ BI's open() does, but not OpenFile() (I believe :-)] > the workaround is to use only SDK functions or >only RTL functions for handle file I/O. a good suggestion. >The low level RTL routines _read(), _write(), etc., appear to work >with both types of handles. > > -- sidney markowitz Hi Sidney. _lread translates into a direct call to DOS, and only cares that its handle be a valid DOS file handle. I'm a low kinda guy, so I just use _lopen() or _lcreat(), and then _lread(), etc for access. -- Don Corbitt, Microsoft Windows