Windows: Add support for returning file IDs from stat and readdir#38
Open
rpaquay wants to merge 4 commits intogradle:masterfrom
Open
Windows: Add support for returning file IDs from stat and readdir#38rpaquay wants to merge 4 commits intogradle:masterfrom
stat and readdir#38rpaquay wants to merge 4 commits intogradle:masterfrom
Conversation
|
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
ac86e6b to
3720c9a
Compare
Also updated tests, since all platforms now include support for file keys
Member
|
Sorry for the late reply. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
FileInfo.getKey()that returns a file identifier than can be used to compareefficiently files for equality. If the key is not available, the method returns
null.https://docs.oracle.com/javase/7/docs/api/java/nio/file/attribute/BasicFileAttributes.html#fileKey()
statandfastReaddirXxxjni entry points to provide this informationfile keyif it is available