Class ByHandleFileInfo
- All Implemented Interfaces:
com.sun.jna.Structure.ByReference
- Direct Known Subclasses:
FullFileInfo
DokanyOperations.GetFileInformation function retrieves.
The identifier that is stored in the nFileIndexHigh and nFileIndexLow members is called the file ID. Support for file IDs is file system-specific. File IDs are not guaranteed to be unique over time, because file systems are free to reuse them. In some cases, the file ID for a file can change over time.
In the FAT file system, the file ID is generated from the first cluster of the containing directory and the byte offset within the directory of the entry for the file. Some defragmentation products change this byte offset. (Windows in-box defragmentation does not.) Thus, a FAT file ID can change over time.Renaming a file in the FAT file system can also change the file ID, but only if the new file name is longer than the old one.
In the NTFS file system, a file keeps the same file ID until it is deleted. You can replace one file with another file without changing the file ID by using the ReplaceFile function. However, the file ID of the replacement file, not the replaced file, is retained as the file ID of the resulting file.
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 a Windows 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 (the access date). On the NTFS file system, access time has a resolution of 1 hour.
-
Nested Class Summary
Nested classes/interfaces inherited from class com.sun.jna.Structure
com.sun.jna.Structure.ByReference, com.sun.jna.Structure.ByValue, com.sun.jna.Structure.FieldOrder, com.sun.jna.Structure.StructField -
Field Summary
FieldsModifier and TypeFieldDescriptionintThe file attributes of a file.intThe number of links to this file.intThe serial number of the volume that contains a file.com.sun.jna.platform.win32.WinBase.FILETIMEA FILETIME structure that specifies when a file or directory was created.com.sun.jna.platform.win32.WinBase.FILETIMEA FILETIME structure.com.sun.jna.platform.win32.WinBase.FILETIMEA FILETIME structure.intThe high-order DWORD value of the file size, in bytes.intThe low-order DWORD value of the file size, in bytes.intThe high-order DWORD value of the file size, in bytes.intThe low-order DWORD value of the file size, in bytes.Fields inherited from class com.sun.jna.Structure
ALIGN_DEFAULT, ALIGN_GNUC, ALIGN_MSVC, ALIGN_NONE, CALCULATE_SIZE -
Constructor Summary
ConstructorsConstructorDescriptionByHandleFileInfo(long creationTime, long lastAccessTime, long lastWriteTime) ByHandleFileInfo(com.sun.jna.platform.win32.WinBase.FILETIME creationTime, com.sun.jna.platform.win32.WinBase.FILETIME lastAccessTime, com.sun.jna.platform.win32.WinBase.FILETIME lastWriteTime) -
Method Summary
Modifier and TypeMethodDescriptionvoidcopyTo(ByHandleFileInfo infoToReceive) final longgetSize()voidsetAttributes(EnumIntegerSet<FileAttribute> attributes) voidsetCreationTime(long creationTime) Also sets lastAccessTime to same time.voidsetIndex(long indexToSet) voidsetLastWriteTime(long lastWriteTime) Also sets lastAccessTime to same time.voidsetSize(long sizeToSet) protected final voidsetSizesExplicit(long size, int sizeHigh, int sizeLow) voidsetTimes(long creationTime, long lastAccessTime, long lastWriteTime) toString()Methods inherited from class com.sun.jna.Structure
allocateMemory, allocateMemory, autoAllocate, autoRead, autoRead, autoWrite, autoWrite, cacheTypeInfo, calculateSize, clear, createFieldsOrder, createFieldsOrder, createFieldsOrder, createFieldsOrder, dataEquals, dataEquals, ensureAllocated, equals, fieldOffset, getAutoRead, getAutoWrite, getFieldList, getFields, getNativeAlignment, getNativeSize, getNativeSize, getPointer, getStringEncoding, getStructAlignment, hashCode, newInstance, newInstance, read, readField, readField, setAlignType, setAutoRead, setAutoSynch, setAutoWrite, setStringEncoding, size, sortFields, toArray, toArray, toString, useMemory, useMemory, write, writeField, writeField, writeField
-
Field Details
-
dwFileAttributes
public int dwFileAttributesThe file attributes of a file. For possible values and their descriptions, see File Attribute Constants. The FILE_ATTRIBUTE_SPARSE_FILE attribute on the file is set if any of the streams of the file have ever been sparse. -
ftCreationTime
public com.sun.jna.platform.win32.WinBase.FILETIME ftCreationTimeA FILETIME structure that specifies when a file or directory was created. If the underlying file system does not support creation time, this member is zero. -
ftLastAccessTime
public com.sun.jna.platform.win32.WinBase.FILETIME ftLastAccessTimeA FILETIME structure. For a file, the structure specifies when the file was last read from, written to, or for executable files, run. For a directory, the structure specifies when the directory is created. If the underlying file system does not support last access time, this member is zero. On the FAT file system, the specified date for both files and directories is correct, but the time of day is always set to midnight. -
ftLastWriteTime
public com.sun.jna.platform.win32.WinBase.FILETIME ftLastWriteTimeA FILETIME structure. For a file, the structure specifies when the file was last written to, truncated, or overwritten, for example, when WriteFile or SetEndOfFile are used. The date and time are not updated when file attributes or security descriptors are changed. 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. -
dwVolumeSerialNumber
public int dwVolumeSerialNumberThe serial number of the volume that contains a file. -
nFileSizeHigh
public int nFileSizeHighThe high-order DWORD value of the file size, in bytes. This value is zero unless the file size is greater than MAXDWORD. The size of the file is equal to (nFileSizeHigh * (MAXDWORD+1)) + nFileSizeLow. -
nFileSizeLow
public int nFileSizeLowThe low-order DWORD value of the file size, in bytes. -
dwNumberOfLinks
public int dwNumberOfLinksThe number of links to this file. For the FAT file system this member is always 1. For the NTFS file system, it can be more than 1. -
nFileIndexHigh
public int nFileIndexHighThe high-order DWORD value of the file size, in bytes. This value is zero unless the file size is greater than MAXDWORD. The size of the file is equal to (nFileSizeHigh* (MAXDWORD+1)) + nFileSizeLow. -
nFileIndexLow
public int nFileIndexLowThe low-order DWORD value of the file size, in bytes.
-
-
Constructor Details
-
ByHandleFileInfo
public ByHandleFileInfo(com.sun.jna.platform.win32.WinBase.FILETIME creationTime, com.sun.jna.platform.win32.WinBase.FILETIME lastAccessTime, com.sun.jna.platform.win32.WinBase.FILETIME lastWriteTime) -
ByHandleFileInfo
public ByHandleFileInfo(long creationTime, long lastAccessTime, long lastWriteTime) -
ByHandleFileInfo
public ByHandleFileInfo()
-
-
Method Details
-
copyTo
-
setAttributes
-
setTimes
public void setTimes(long creationTime, long lastAccessTime, long lastWriteTime) -
setLastWriteTime
public void setLastWriteTime(long lastWriteTime) Also sets lastAccessTime to same time.- Parameters:
lastWriteTime-
-
setCreationTime
public void setCreationTime(long creationTime) Also sets lastAccessTime to same time.- Parameters:
creationTime-
-
setSize
public void setSize(long sizeToSet) -
setSizesExplicit
protected final void setSizesExplicit(long size, int sizeHigh, int sizeLow) -
getSize
public final long getSize() -
setIndex
public void setIndex(long indexToSet) -
getFieldOrder
- Overrides:
getFieldOrderin classcom.sun.jna.Structure
-
toString
- Overrides:
toStringin classcom.sun.jna.Structure
-