windows_programming_notes.nbk: Home | Index | Next Page: window message path | Previous Page: win32 windows


 WIN32_FILE_ATTRIBUTE_DATA

Contains attribute information for a file or directory. The GetFileAttributesEx function uses this structure.

    typedef struct _WIN32_FILE_ATTRIBUTE_DATA {  
        DWORD dwFileAttributes;  
        FILETIME ftCreationTime;  
        FILETIME ftLastAccessTime;  
        FILETIME ftLastWriteTime;  
        DWORD nFileSizeHigh;  
        DWORD nFileSizeLow;
    } WIN32_FILE_ATTRIBUTE_DATA,  *LPWIN32_FILE_ATTRIBUTE_DATA;

Members

Attribute Meaning FILE_ATTRIBUTE_ARCHIVE 0x00000020 The file or directory is an archive file.

Applications use this attribute to mark files for backup or removal.

FILE_ATTRIBUTE_COMPRESSED 0x00000800 The file or directory is compressed.

For a file, this means that all of the data in the file is compressed.

For a directory, this means that compression is the default for newly created files and subdirectories.

FILE_ATTRIBUTE_DIRECTORY 0x00000010 The handle identifies a directory.

FILE_ATTRIBUTE_ENCRYPTED 0x00004000 The file or directory is encrypted.

For a file, this means that all data in the file is encrypted.

For a directory, this means that encryption is the default for newly created files and subdirectories.

FILE_ATTRIBUTE_HIDDEN 0x00000002 The file or directory is hidden.

It is not included in an ordinary directory listing.

FILE_ATTRIBUTE_NORMAL 0x00000080 The file or directory does not have another attributes set.

This attribute is valid only if used alone.

FILE_ATTRIBUTE_OFFLINE 0x00001000 The data of the file is not immediately available.

This attribute indicates that the file data has been physically moved to offline storage.

This attribute is used by Remote Storage, the hierarchical storage management software. Applications should not arbitrarily change this attribute.

FILE_ATTRIBUTE_READONLY 0x00000001 The file or directory is read-only.

Applications can read the file but cannot write to it or delete it.

For a directory, applications cannot delete it.

FILE_ATTRIBUTE_REPARSE_POINT 0x00000400 The file or directory has an associated reparse point.

FILE_ATTRIBUTE_SPARSE_FILE 0x00000200 The file is a sparse file.

FILE_ATTRIBUTE_SYSTEM 0x00000004 The file or directory is part of the operating system, or is used exclusively by the operating system.

FILE_ATTRIBUTE_TEMPORARY 0x00000100 The file is being used for temporary storage.

File systems avoid writing data back to mass storage if sufficient cache memory is available, because often the application deletes the temporary file shortly after the handle is closed. In that case, the system can entirely avoid writing the data. Otherwise, the data is written after the handle is closed.

FILE_ATTRIBUTE_VIRTUAL 0x00010000 A file is a virtual file.

ftCreationTime A FILETIME structure that specifies when the file or directory is created.

If the underlying file system does not support creation time, this member is zero (0).

ftLastAccessTime A FILETIME structure.

For a file, the structure specifies when the file is last read from or written to.

For a directory, the structure specifies when the directory is created.

For both files and directories, the specified date is correct, but the time of day is always set to midnight. If the underlying file system does not support last access time, this member is zero (0).

ftLastWriteTime A FILETIME structure.

For a file, the structure specifies when the file is last written to.

For a directory, the structure specifies when the directory is created.

If the underlying file system does not support last write time, this member is zero (0).

nFileSizeHigh The high-order DWORD of the file size.

This member does not have a meaning for directories.

nFileSizeLow The low-order DWORD of the file size.

This member does not have a meaning for directories.

Remarks

Not all file systems can record creation and last access time, and not all file systems record them in the same manner. For example, on the FAT file system, create time has a resolution of 10 milliseconds, write time has a resolution of 2 seconds, and access time has a resolution of 1 day (really, the access date). On the NTFS file system, access time has a resolution of 1 hour. For more information, see File Times.

Requirements


windows_programming_notes.nbk: Home | Index | Next Page: window message path | Previous Page: win32 windows


Notebook exported on Monday, 7 July 2008, 18:56:50 PM Eastern Daylight Time