Partager via


BY_HANDLE_FILE_INFORMATION

A version of this page is also available for

Windows Embedded CE 6.0 R3

4/8/2010

This structure contains information obtained by the GetFileInformationByHandle function.

Syntax

typedef struct _BY_HANDLE_FILE_INFORMATION { 
  DWORD dwFileAttributes; 
  FILETIME ftCreationTime; 
  FILETIME ftLastAccessTime; 
  FILETIME ftLastWriteTime; 
  DWORD dwVolumeSerialNumber; 
  DWORD nFileSizeHigh; 
  DWORD nFileSizeLow; 
  DWORD nNumberOfLinks; 
  DWORD nFileIndexHigh; 
  DWORD nFileIndexLow;
  DWORD dwOID;
} BY_HANDLE_FILE_INFORMATION; 

Members

  • dwFileAttributes
    File attributes. The following table shows possible values.

    Value Description

    FILE_ATTRIBUTE_ARCHIVE

    Indicates that the file or directory is an archive file. Applications use this attribute to mark files for backup or removal.

    FILE_ATTRIBUTE_COMPRESSED

    Indicates that the file or directory is compressed. For a file, this means that all 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

    Indicates that the handle identifies a directory.

    FILE_ATTRIBUTE_ENCRYPTED

    Indicates that the file or directory is encrypted. For a file, this means that all data streams are encrypted. For a directory, this means that encryption is the default for newly created files and directories.

    FILE_ATTRIBUTE_HIDDEN

    Indicates that the file or directory is hidden. It is not included in an ordinary directory listing.

    FILE_ATTRIBUTE_INROM

    Indicates that the file is an operating system file stored in ROM. These files are read-only. They cannot be modified.

    FILE_ATTRIBUTE_NORMAL

    Indicates that the file has no other attributes. This attribute is valid only if used alone.

    FILE_ATTRIBUTE_READONLY

    Indicates that the file or directory is read-only. Applications can read the file, but cannot write to it or delete it. In the case of a directory, applications cannot delete it.

    FILE_ATTRIBUTE_REPARSE_POINT

    Indicates that the file has an associated reparse point.

    FILE_ATTRIBUTE_ROMMODULE

    Indicates that this file is an operating system file stored in ROM, designed to execute in place. In other words, code from this file runs directly from ROM, rather than being first copied to RAM. The CreateFile function cannot be used to access this file. Instead the LoadLibrary and the CreateProcess functions must be used.

    FILE_ATTRIBUTE_ROMSTATICREF

    Indicates that the DLL module is implicitly linked to another module in the ROM file system. This prevents the DLL module from being replaced by a RAM version of the DLL.

    FILE_ATTRIBUTE_SPARSE_FILE

    Indicates that the file is a sparse file.

    FILE_ATTRIBUTE_SYSTEM

    Indicates that the file or directory is part of the operating system or is used exclusively by the operating system.

    FILE_ATTRIBUTE_TEMPORARY

    Indicates that the file is being used for temporary storage. File systems attempt to keep all data in memory for quicker access, rather than flushing the data back to mass storage. A temporary file should be deleted as soon as it is no longer needed.

  • ftCreationTime
    Time at which the file was created. If the underlying file system does not support this member, it is set to zero.
  • ftLastAccessTime
    Time at which the file was last accessed. If the underlying file system does not support this member, it is set to zero.
  • ftLastWriteTime
    Last time the file was written to.
  • dwVolumeSerialNumber
    Serial number of the volume that contains the file.
  • nFileSizeHigh
    High-order word of the file size.
  • nFileSizeLow
    Low-order word of the file size.
  • nNumberOfLinks
    Number of links to this file. For the FAT file system, this member is always set to 1.
  • nFileIndexHigh
    High-order word of a unique identifier associated with the file.
  • nFileIndexLow
    Low-order word of a unique identifier associated with the file. This identifier and the volume serial number uniquely identify a file. This number can change when the system is restarted or when the file is opened. After a process opens a file, the identifier is constant until the file is closed. An application can use this identifier and the volume serial number to determine whether two handles refer to the same file.
  • dwOID
    Object identifier (OID) of the file. This parameter is valid only on files that are stored in the object store. Files on external file systems do not have object identifiers associated with them.

    Note

    Windows CE 2.12 and earlier assigned OIDs to objects in other file systems, such as the FAT file system. These OIDs were guaranteed to be unique within a volume, but not across multiple volumes. Effective with Windows CE 3.0, the only file and directory objects that have valid, unique OIDs are in the object store. Database objects, on any file system, have valid, unique OIDs.

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, the object store RAM file system maintains only the last modified time.

Requirements

Header winbase.h
Windows Embedded CE Windows CE 1.0 and later
Windows Mobile Windows Mobile Version 5.0 and later

See Also

Reference

File I/O Structures
GetFileInformationByHandle

Other Resources

FILETIME