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.
DosSetFileMode (1.2)
Function Group  Overview                          Up Next Previous
────────────────────────────────────────────────────────────────────────────
 
#define INCL_DOSFILEMGR
 
USHORT DosSetFileMode(pszFileName, usAttribute, ulReserved)
PSZ pszFileName;       /* filename           */
USHORT usAttribute;    /* new file attribute */
ULONG ulReserved;      /* must be zero       */
 
The DosSetFileMode function sets the file attributes of the specified file.
A file's mode is defined by the settings of its attributes.
 
The DosSetFileMode function is a family API function.
 
Parameter    Description
────────────────────────────────────────────────────────────────────────────
 
pszFileName  Points to a null-terminated string that specifies the name of
             the file. The string must be a valid MS OS/2 filename.
 
usAttribute  Specifies the file's new attributes. This parameter can be a
             combination of the following values:
 
             Value          Meaning
             ───────────────────────────────────────────────────────────────
             FILE_NORMAL    File can be read from or written to.
 
             FILE_READONLY  File can be read from but not written to.
 
             FILE_HIDDEN    File is hidden and does not appear when a
                            directory is listed.
 
             FILE_SYSTEM    File is a system file.
 
             FILE_ARCHIVED  File has been archived.
 
             The FILE_NORMAL value can be combined only with the
             FILE_ARCHIVED value.
 
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_ACCESS_DENIED
     ERROR_DRIVE_LOCKED
     ERROR_FILE_NOT_FOUND
     ERROR_NOT_DOS_DISK
     ERROR_PATH_NOT_FOUND
     ERROR_SHARING_BUFFER_EXCEEDED
     ERROR_SHARING_VIOLATION
 
See Also
 
DosQFileMode