Partager via


Reading and Writing File Attributes (Windows Embedded CE 6.0)

1/6/2010

Windows Embedded 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 shows the file attributes involved for each of these functions.

Flag CreateFile GetFileAttributes SetFileAttributes

FILE_ATTRIBUTE_ARCHIVE

X

X

X

FILE_ATTRIBUTE_COMPRESSED

X

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

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 also use the GetFileSize function to return the size of a file.

See Also

Concepts

Obtaining and Setting File Information
File System Operations