en:docs:fapi:dossetfilemode

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
en:docs:fapi:dossetfilemode [2018/08/28 09:29] – created prokusheven:docs:fapi:dossetfilemode [2021/09/17 08:36] (current) prokushev
Line 1: Line 1:
 +{{page>en:templates:fapiint}}
 +
 +====== DosSetFileMode ======
 +
 This call changes the mode (attribute) of the specified file. This call changes the mode (attribute) of the specified file.
  
-==Syntax== +===== Syntax ===== 
- DosSetFileMode (FileName, NewAttribute, Reserved) +<code c> 
 +DosSetFileMode (FileName, NewAttribute, Reserved)  
 +</code>
  
-==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. +  FileName ([[PSZ]]) - input : Address of the file path name. 
-;NewAttribute (USHORT) - input : File's new attribute. File attributes are defined as follows: + 
- '''Bit        Description''' +[[DosQSysInfo]] is called by an application during initialization to determine the maximum path length allowed by OS/2. 
- 15-6        Reserved and must be zero. + 
-        File archive +  * NewAttribute ([[USHORT]]) - input : File's new attribute. File attributes are defined as follows: 
-        Subdirectory + 
-        Volume label +Bit Description ^ 
-        System file (excluded from normal directory searches) +15-6 Reserved and must be zero | 
-        Hidden file +File archive | 
-        Read only file +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. +Volume label | 
-;Reserved (ULONG) - input : Reserved must be set to zero.+System file (excluded from normal directory searches) | 
 +Hidden file | 
 +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 40: 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=== + 
-<PRE>+==== C Binding ===
 + 
 +<code c>
 #define INCL_DOSFILEMGR #define INCL_DOSFILEMGR
  
Line 52: Line 70:
  
 USHORT           rc;            /* return code */ USHORT           rc;            /* return code */
-</PRE>+</code>
  
-===MASM Binding=== +==== MASM Binding ===
-<PRE>+ 
 +<code asm>
 EXTRN  DosSetFileMode:FAR EXTRN  DosSetFileMode:FAR
 INCL_DOSFILEMGR     EQU 1 INCL_DOSFILEMGR     EQU 1
Line 65: Line 84:
  
 Returns WORD Returns WORD
-</PRE>+</code> 
 + 
 +===== Note =====
  
-=== Note === 
  
 Text based on http://www.edm2.com/index.php/DosSetFileMode Text based on http://www.edm2.com/index.php/DosSetFileMode