no way to compare when less than two revisions
Differences
This shows you the differences between two versions of the page.
Next revision | |||
— | en:docs:fapi:dossetfilemode [2018/08/28 09:29] – created prokushev | ||
---|---|---|---|
Line 1: | Line 1: | ||
+ | This call changes the mode (attribute) of the specified file. | ||
+ | |||
+ | ==Syntax== | ||
+ | | ||
+ | |||
+ | ==Parameters== | ||
+ | ;FileName (PSZ) - input : Address of the file path name. | ||
+ | : | ||
+ | ; | ||
+ | ''' | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | :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. | ||
+ | ;Reserved (ULONG) - input : Reserved must be set to zero. | ||
+ | |||
+ | ==Return Code== | ||
+ | rc (USHORT) - return | ||
+ | Return code descriptions are: | ||
+ | * 0 NO_ERROR | ||
+ | * 2 ERROR_FILE_NOT_FOUND | ||
+ | * 3 ERROR_PATH_NOT_FOUND | ||
+ | * 5 ERROR_ACCESS_DENIED | ||
+ | * 26 ERROR_NOT_DOS_DISK | ||
+ | * 32 ERROR_SHARING_VIOLATION | ||
+ | * 36 ERROR_SHARING_BUFFER_EXCEEDED | ||
+ | * 87 ERROR_INVALID_PARAMETER | ||
+ | * 108 ERROR_DRIVE_LOCKED | ||
+ | * 206 ERROR_FILENAME_EXCED_RANGE | ||
+ | |||
+ | ==Remarks== | ||
+ | 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. | ||
+ | |||
+ | ==Example Code== | ||
+ | === C Binding=== | ||
+ | <PRE> | ||
+ | #define INCL_DOSFILEMGR | ||
+ | |||
+ | USHORT | ||
+ | |||
+ | PSZ FileName; | ||
+ | USHORT | ||
+ | ULONG 0; /* Reserved (must be zero) */ | ||
+ | |||
+ | USHORT | ||
+ | </ | ||
+ | |||
+ | ===MASM Binding=== | ||
+ | <PRE> | ||
+ | EXTRN DosSetFileMode: | ||
+ | INCL_DOSFILEMGR | ||
+ | |||
+ | PUSH@ ASCIIZ | ||
+ | PUSH | ||
+ | PUSH | ||
+ | CALL | ||
+ | |||
+ | Returns WORD | ||
+ | </ | ||
+ | |||
+ | === Note === | ||
+ | |||
+ | Text based on http:// | ||
+ | |||
+ | {{page> | ||
+ | |||