Reading and Writing File Attributes

Windows CE 3.0

Windows CE provides a variety of functions to identify and modify the status of a file. You can set the parameters of a file when you first create the file by calling the CreateFile function. After you create the file, you can view the file attributes by using the GetFileAttributes function, and you can modify the file attributes by using the SetFileAttributes function. The following table describes what file attributes you can interact with by using GetFileAttributes, SetFileAttributes, and CreateFile.

Flag CreateFile GetFile
Attributes
SetFile
Attributes
FILE_ATTRIBUTE_ARCHIVE X X X
FILE_ATTRIBUTE_COMPRESSED   X  
FILE_ATTRIBUTE_DIRECTORY   X  
FILE_ATTRIBUTE_ENCRYPTED   X  
FILE_ATTRIBUTE_HIDDEN X X X
FILE_ATTRIBUTE_INROM   X  
FILE_ATTRIBUTE_NORMAL X X X
FILE_ATTRIBUTE_OFFLINE   X X
FILE_ATTRIBUTE_READONLY X X X
FILE_ATTRIBUTE_REPARSE_POINT   X  
FILE_ATTRIBUTE_ROMMODULE   X  
FILE_ATTRIBUTE_SPARSE_FILE   X  
FILE_ATTRIBUTE_SYSTEM X X X
FILE_ATTRIBUTE_TEMPORARY   X  
FILE_FLAG_WRITE_THROUGH X    
FILE_FLAG_RANDOM_ACCESS X    
FILE_ATTRIBUTE_ROMSTATICREF   X  

You can use also the GetFileSize function to return the size of a file.


Show: