Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revision | |||
en:docs:fapi:dossetfilemode [2021/08/21 11:24] – prokushev | en:docs:fapi:dossetfilemode [2021/09/17 08:36] (current) – prokushev | ||
---|---|---|---|
Line 5: | Line 5: | ||
This call changes the mode (attribute) of the specified file. | This call changes the mode (attribute) of the specified file. | ||
- | ==Syntax== | + | ===== Syntax ===== |
- | | + | <code c> |
+ | DosSetFileMode (FileName, NewAttribute, | ||
+ | </ | ||
- | ==Parameters== | + | ===== Parameters ===== |
- | ;FileName (PSZ) - input : Address of the file path name. | + | |
- | :[[DosQSysInfo]] is called by an application during initialization to determine the maximum path length allowed by OS/2. | + | |
- | ;NewAttribute (USHORT) - input : File's new attribute. File attributes are defined as follows: | + | |
- | ''' | + | [[DosQSysInfo]] is called by an application during initialization to determine the maximum path length allowed by OS/2. |
- | | + | |
- | | + | * NewAttribute ([[USHORT]]) - input : File's new attribute. File attributes are defined as follows: |
- | | + | |
- | | + | ^ Bit ^ Description |
- | | + | | 15-6 | Reserved and must be zero | |
- | | + | | 5 | File archive |
- | | + | | 4 | Subdirectory |
- | :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. | + | | 3 | Volume label | |
- | ;Reserved (ULONG) - input : Reserved must be set to zero. | + | | 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. | ||
+ | |||
+ | * Reserved ([[ULONG]]) - input : Reserved must be set to zero. | ||
+ | |||
+ | ===== Return Code ===== | ||
+ | |||
+ | rc ([[USHORT]]) - return | ||
- | ==Return Code== | ||
- | rc (USHORT) - return | ||
Return code descriptions are: | 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== | + | * 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. | Attributes for Volume Label (0008H) and Subdirectory (0010H) cannot be changed using DosSetFileMode. If these attributes are specified, ERROR_INVALID_PARAMETER is returned. | ||
Line 44: | Line 56: | ||
Attributes of root directories cannot be changed using DosSetFileMode. If these attributes are specified, ERROR_ACCESS_DENIED is returned. | Attributes of root directories cannot be changed using DosSetFileMode. If these attributes are specified, ERROR_ACCESS_DENIED is returned. | ||
- | ==Example Code== | + | ===== Example Code ===== |
- | === C Binding=== | + | |
+ | ==== C Binding ==== | ||
<code c> | <code c> | ||
#define INCL_DOSFILEMGR | #define INCL_DOSFILEMGR | ||
Line 58: | Line 72: | ||
</ | </ | ||
- | ===MASM Binding=== | + | ==== MASM Binding ==== |
<code asm> | <code asm> | ||
EXTRN DosSetFileMode: | EXTRN DosSetFileMode: | ||
Line 71: | Line 86: | ||
</ | </ | ||
- | === Note === | + | ===== Note ===== |
Text based on http:// | Text based on http:// |