Opens a new file, an existing file, or a replacement for an existing file. An open file can have extended attributes.

#define INCL_DOSFILEMGR
#include <os2.h>

PSZ       pszFileName;  /*  Address of the ASCIIZ path name of the file or device to be opened. */
PHFILE    pHf;          /*  Address of the handle for the file. */
PULONG    pulAction;    /*  Address of the variable that receives the value that specifies the action taken by the DosOpen function. */
ULONG     cbFile;       /*  New logical size of the file (end of data, EOD), in bytes. */
ULONG     ulAttribute;  /*  File attribute information. */
ULONG     fsOpenFlags;  /*  The action to be taken depending on whether the file exists or does not exist. */
ULONG     fsOpenMode;   /*  The mode of the open function. Possible values are shown in the following list: */
PEAOP2    peaop2;       /*  Extended attributes. */
APIRET    ulrc;         /*  Return Code. */

ulrc = DosOpen(pszFileName, pHf, pulAction,
         cbFile, ulAttribute, fsOpenFlags,
         fsOpenMode, peaop2);


[Back] [Next]