java.lang.Object
com.sun.jna.Structure
org.cryptomator.frontend.dokany.internal.structure.ByHandleFileInfo
All Implemented Interfaces:
com.sun.jna.Structure.ByReference
Direct Known Subclasses:
FullFileInfo

public class ByHandleFileInfo extends com.sun.jna.Structure implements com.sun.jna.Structure.ByReference
Contains information that the 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

    Fields
    Modifier and Type
    Field
    Description
    int
    The file attributes of a file.
    int
    The number of links to this file.
    int
    The serial number of the volume that contains a file.
    com.sun.jna.platform.win32.WinBase.FILETIME
    A FILETIME structure that specifies when a file or directory was created.
    com.sun.jna.platform.win32.WinBase.FILETIME
    A FILETIME structure.
    com.sun.jna.platform.win32.WinBase.FILETIME
    A FILETIME structure.
    int
    The high-order DWORD value of the file size, in bytes.
    int
    The low-order DWORD value of the file size, in bytes.
    int
    The high-order DWORD value of the file size, in bytes.
    int
    The 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

    Constructors
    Constructor
    Description
     
    ByHandleFileInfo(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 Type
    Method
    Description
    void
    copyTo(ByHandleFileInfo infoToReceive)
     
     
    final long
     
    void
     
    void
    setCreationTime(long creationTime)
    Also sets lastAccessTime to same time.
    void
    setIndex(long indexToSet)
     
    void
    setLastWriteTime(long lastWriteTime)
    Also sets lastAccessTime to same time.
    void
    setSize(long sizeToSet)
     
    protected final void
    setSizesExplicit(long size, int sizeHigh, int sizeLow)
     
    void
    setTimes(long creationTime, long lastAccessTime, long lastWriteTime)
     
     

    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

    Methods inherited from class java.lang.Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait
  • Field Details

    • dwFileAttributes

      public int dwFileAttributes
      The 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 ftCreationTime
      A 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 ftLastAccessTime
      A 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 ftLastWriteTime
      A 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 dwVolumeSerialNumber
      The serial number of the volume that contains a file.
    • nFileSizeHigh

      public int nFileSizeHigh
      The 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 nFileSizeLow
      The low-order DWORD value of the file size, in bytes.
    • nFileIndexHigh

      public int nFileIndexHigh
      The 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 nFileIndexLow
      The 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

      public void copyTo(ByHandleFileInfo infoToReceive)
    • setAttributes

      public void setAttributes(EnumIntegerSet<FileAttribute> attributes)
    • 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

      public List<String> getFieldOrder()
      Overrides:
      getFieldOrder in class com.sun.jna.Structure
    • toString

      public String toString()
      Overrides:
      toString in class com.sun.jna.Structure