Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Windows: Add support for returning file IDs from stat and readdir #38

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

rpaquay
Copy link
Contributor

@rpaquay rpaquay commented May 22, 2019

  • Add FileInfo.getKey() that returns a file identifier than can be used to compare
    efficiently files for equality. If the key is not available, the method returns
    null.
  • This is a similar concept as exposed in the Java 7 nio API
    https://docs.oracle.com/javase/7/docs/api/java/nio/file/attribute/BasicFileAttributes.html#fileKey()
  • A WindowsFileKey is a pair of (volume serial number, file id on the volume)
  • Update the stat and fastReaddirXxx jni entry points to provide this information
  • Update the test app to display file key if it is available

@lacasseio
Copy link

Make sure only the commit for this PR is included.

* NtQueryDirectoryFile is more efficient than FindFindFile/FindNextFile
* Include a minimal copy of "ntifs.h" containing the definitions required
  to call NtQueryDirectoryFile and RtlNtStatusToDosError.
* Use a new set of JNI entry point to maximize performance. Instead
  of c++ code calling back into Java, we use a DirectByteBuffer to share
  native memory between C++ and Java, making the JNI interface less chatty
  and more efficient. This is about 20% faster than using Java callbacks.
* This is available on Windows Vista/Windows Server 2008 and later.
* Add entry point to check if new API is supported
* Add `FileInfo.getKey()` that returns a file identifier than can be used to compare
  efficiently files for equality. If the key is not available, the method returns
  `null`.
* This is a similar concept as exposed in the Java 7 nio API
  https://docs.oracle.com/javase/7/docs/api/java/nio/file/attribute/BasicFileAttributes.html#fileKey()
* A WindowsFileKey is a pair of (volume serial number, file id on the volume)
* Update the `stat` and `fastReaddirXxx` jni entry points to provide this information
* Update the test app to display `file key` if it is available
Also updated tests, since all platforms now include support for file keys
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants