Browse Prior Art Database

DosGetSize Program

IP.com Disclosure Number: IPCOM000122029D
Original Publication Date: 1991-Oct-01
Included in the Prior Art Database: 2005-Apr-04
Document File: 2 page(s) / 59K

Publishing Venue

IBM

Related People

Weber, O: AUTHOR

Abstract

This article describes a consistent mechanism for retrieving the size of an OS/2* object. Currently, the only methods for retrieving the size of an OS/2 object require that the user know several things about the object, including the type of object it is, and what its status is at the time the request is made. The latter is particularly hazardous, because the object's status can change at any time. Also, as will be demonstrated below, since the application may not know the type and/or status of the object, it does not know where to look for the returned size. There needs to be a single and consistent API (Application Programming Interface) to determine the size of any OS/2 object, regardless of its type or status.

This text was extracted from an ASCII text file.
This is the abbreviated version, containing approximately 54% of the total text.

DosGetSize Program

      This article describes a consistent mechanism for
retrieving the size of an OS/2* object.  Currently, the only methods
for retrieving the size of an OS/2 object require that the user know
several things about the object, including the type of object it is,
and what its status is at the time the request is made.  The latter
is particularly hazardous, because the object's status can change at
any time. Also, as will be demonstrated below, since the application
may not know the type and/or status of the object, it does not know
where to look for the returned size.  There needs to be a single and
consistent API (Application Programming Interface) to determine the
size of any OS/2 object, regardless of its type or status.  If the
object is a file, and this file is currently closed, then the DosOpen
API can be used to open the closed file.  Then, the DosQFileInfo API
can be used to return the size of the file in the "fstatus"
structure.  Then a DosClose can be used to close the file. However,
if the object is a file, and this file happens to already be open,
then the DosOpen fails, and a DosFindFirst API must be issued, which
then returns the size of the file in the "filefindbuf" structure, and
the DosClose should not be issued to close the file since it was
opened elsewhere (and in this case, the DosClose would fail anyway
since the handle would be invalid). In this case, the DosFindClose
would be issued.  However, if the object is a subdirect...