This is part of Family API which allow to create dual-os version of program runs under OS/2 and DOS
Note: This is legacy API call. It is recommended to use 32-bit equivalent
This call changes the mode (attribute) of the specified file.
DosSetFileMode (FileName, NewAttribute, Reserved)
DosQSysInfo is called by an application during initialization to determine the maximum path length allowed by OS/2.
Bit | Description |
---|---|
15-6 | Reserved and must be zero |
5 | File archive |
4 | Subdirectory |
3 | Volume label |
2 | System file (excluded from normal directory searches) |
1 | Hidden file |
0 | Read only file |
These bits may be set individually or in combination. For example, an attribute value of 0021H (bits 5 and 0 set to 1) indicates a read-only file that should be archived.
rc (USHORT) - return
Return code descriptions are:
Attributes for Volume Label (0008H) and Subdirectory (0010H) cannot be changed using DosSetFileMode. If these attributes are specified, ERROR_INVALID_PARAMETER is returned.
DosQFileMode is used to query the current settings for file attributes. Calling DosQFSInfo obtains volume label information.
Attributes of root directories cannot be changed using DosSetFileMode. If these attributes are specified, ERROR_ACCESS_DENIED is returned.
#define INCL_DOSFILEMGR USHORT rc = DosSetFileMode(FileName, NewAttribute, Reserved); PSZ FileName; /* File path name string */ USHORT NewAttribute; /* New attribute of file */ ULONG 0; /* Reserved (must be zero) */ USHORT rc; /* return code */
EXTRN DosSetFileMode:FAR INCL_DOSFILEMGR EQU 1 PUSH@ ASCIIZ FileName ;File path name string PUSH WORD NewAttribute ;New attribute of file PUSH DWORD 0 ;Reserved (must be zero) CALL DosSetFileMode Returns WORD
Text based on http://www.edm2.com/index.php/DosSetFileMode