🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

using OpenFile in BC++ (was Re: MS Windows Classes)

#2368
From: Sidney Markowitz
Date: Tue, 30 Apr 1991 11:55
26 lines
1830 bytes
ebergman@isis.UUCP (Eric Bergman-Terrell) writes:
>What problem did you have calling OpenFile from BC++ 2.0?  Care to post a
>code fragment?  Did you call it in?  What did they say?
[...]
>BTW I just checked my Windows application - I'm using OpenFile to make
>sure a file exists (but not to actually open it).  Seems to work OK

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.

The handle that is returned by open() can be used by read(), write(),
etc., but not by _lread(), _lwrite(), etc.

The problem is that both OpenFile() and open() use some auxillary data
structures in parallel with the DOS file handles, and OpenFile() is
compatible with the Windows SDK and MSC RTL, while open() is backwards
compatible with the TC++ RTL. Call it a bug or a compatibility issue
(it's at least a bug in the documentation that mention of it was left
out), but in any case the workaround is to use only SDK functions or
only RTL functions for handle file I/O.

The low level RTL routines _read(), _write(), etc., appear to work
with both types of handles.

 -- sidney markowitz <sidney@borland.com>
Technical Details
Message-ID: <1991Apr30.115545.5197@borland.com>
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!bonnie.concordia.ca!thunder.mcrcim.mcgill.edu!snorkelwacker.mit.edu!spool.mu.edu!mips!swrinde!elroy.jpl.nasa.gov!decwrl!borland.com!sidney
References: <1991Apr23> <149000023@primerd> <1991Apr30.025244.5815@mnemosyne.cs.du.edu>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!bonnie.concordia.ca!thunder.mcrcim.mcgill.edu!snorkelwacker.mit.edu!spool.mu.edu!mips!swrinde!elroy.jpl.nasa.gov!decwrl!borland.com!sidney
From: sidney@borland.com (Sidney Markowitz)
Newsgroups: comp.windows.ms.programmer
Subject: using OpenFile in BC++ (was Re: MS Windows Classes)
Message-ID: <1991Apr30.115545.5197@borland.com>
Date: 30 Apr 91 11:55:45 GMT
References: <1991Apr23> <149000023@primerd> <1991Apr30.025244.5815@mnemosyne.cs.du.edu>
Organization: Borland International
Lines: 26