uschindler commented on code in PR #14627: URL: https://github.com/apache/lucene/pull/14627#discussion_r2079584683
########## lucene/test-framework/src/java/org/apache/lucene/tests/mockfile/WindowsFS.java: ########## @@ -58,7 +58,13 @@ private Object getKey(Path existing) throws IOException { BasicFileAttributeView view = Files.getFileAttributeView(existing, BasicFileAttributeView.class); BasicFileAttributes attributes = view.readAttributes(); - return attributes.fileKey(); + Object key = attributes.fileKey(); + if (key != null) { + return key; + } + // the key may be null, e.g. on real Windows! + // in that case we fallback to the real path + return existing.toRealPath(); Review Comment: > and maybe the fileKey should have just never been used all along. There is a hardlinks functionality on linux, which was maybe why I tried to use inode... Yes for hardlinks (we use them for addIndexes) it might be useful. So I made it to just fallback to the path if no fileKey is available. So we have best on both worlds. On Windows, here there are no hardlinks (or links at all without being root) the fallback to path solves all issues. To me it was important: If WindowsFS is used on Posix, we won't cause unwanted failures. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: issues-unsubscr...@lucene.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: issues-unsubscr...@lucene.apache.org For additional commands, e-mail: issues-h...@lucene.apache.org