dos12.hlp (Table of Contents; Topic list)
Important Notice
The pages on this site contain documentation for very old MS-DOS software, purely for historical purposes. If you're looking for up-to-date documentation, particularly for programming, you should not rely on the information found here, as it will be woefully out of date.
DosQFileMode (1.2)
Function Group  Overview                          Up Next Previous
────────────────────────────────────────────────────────────────────────────
 
#define INCL_DOSFILEMGR
 
USHORT DosQFileMode(pszFileName, pusAttribute, ulReserved)
PSZ pszFileName;         /* pointer to filename                     */
PUSHORT pusAttribute;    /* pointer to variable for file attributes */
ULONG ulReserved;        /* must be zero                            */
 
The DosQFileMode function retrieves the attributes (mode) of the specified
file. The file attributes are set when the file is created and can be
changed at any time by using the DosSetFileMode function.
 
The DosQFileMode function is a family API function.
 
Parameter     Description
────────────────────────────────────────────────────────────────────────────
 
pszFileName   Points to a null-terminated string that specifies the name of
              the file to be checked. The string must be a valid MS OS/2
              filename, and cannot contain any wildcard characters.
 
pusAttribute  Points to the variable that receives the file attributes. It
              can be one or more of the following values:
 
              Value           Meaning
              ──────────────────────────────────────────────────────────────
              FILE_NORMAL     File can be read from and written to.
 
              FILE_READONLY   File can be read from but not written to.
 
              FILE_HIDDEN     File is hidden and does not appear in a
                              directory listing.
 
              FILE_SYSTEM     File is a system file.
 
              FILE_DIRECTORY  File is a subdirectory.
 
              FILE_ARCHIVED   File has been archived.
 
ulReserved    Specifies a reserved value; must be zero.
 
Return Value
 
The return value is zero if the function is successful. Otherwise, it is an
error value, which may be one of the following:
 
     ERROR_DRIVE_LOCKED
     ERROR_FILE_NOT_FOUND
     ERROR_NOT_DOS_DISK
     ERROR_PATH_NOT_FOUND
 
Comments
 
You cannot use the DosQFileMode function to retrieve the attributes of the
volume label. The attributes of a volume label can be retrieved by using the
DosQFSInfo function.
 
Example
 
This example calls the DosQFileMode function and displays a message if the
filename abc is a subdirectory:
 
USHORT usAttribute;
DosQFileMode("abc",     /* filename                                 */
    &usAttribute,       /* address of variable for file's attribute */
    0L);                /* reserved                                 */
if (usAttribute == FILE_DIRECTORY)
    VioWrtTTY("abc is a subdirectory\r\n", 23, 0);
 
See Also
 
DosQFHandState, DosQFSInfo, DosSetFileMode