JavaIoFilesystem is using java.io.File for most of the methods which has a disadvantage of requiring conversion to java.nio.file.Path in some methods but more importantly it makes JavaIoFilesystem jimfs, which relies on java.nio.file.Path, impossible to use. On a related note, I've noticed that some methods, like delete can be replaced with standard library functions like Files.delete and getDirectoryEntries can be implemented using Files.list. I'm guessing that it's because this filesystem implementation had to support older Java versions. Does anyone have any objections to migrate or at least add an additional getNioPath method in addition to getIoFile that can be used by methods that operate on java.nio.file.Path instead of java.io.File?
--
You received this message because you are subscribed to the Google Groups "bazel-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to bazel-dev+unsubscribe@googlegroups.com.
To post to this group, send email to baze...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/bazel-dev/bdafbb1d-d2ec-4f19-bb35-267487a2b5a6%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Hi Taras,our vfs predates java.nio.file, which should explain some of the differences. However, we're reluctant to switch to java.nio.file wholesale - we're routinely handling hundreds of thousands of paths, and memory consumption and performance are critical. We're actually planning some rather invasive changes to the current vfs.Path and PathFragment classes to significantly reduce the overhead, which we likely wouldn't be able to make with java.nio.file.Another issue is that we support extensive profiling for the vfs, so it's imperative that we don't use two different file system abstractions.We've also talked about removing exists(), isReadable(), isWritable(), and friends entirely. Even within Bazel, these should rarely, if ever, be used. Almost all Bazel code should delegate to FileFunction, which is tracked in Skyframe, and not talk to the file system directly.Also note that we have our own InMemoryFileSystem, which may not be as good as jimfs, but seems to work fine for us.Cheers,-- Ulf
On Mon, Oct 23, 2017 at 4:47 AM, <taras....@gmail.com> wrote:
JavaIoFilesystem is using java.io.File for most of the methods which has a disadvantage of requiring conversion to java.nio.file.Path in some methods but more importantly it makes JavaIoFilesystem jimfs, which relies on java.nio.file.Path, impossible to use. On a related note, I've noticed that some methods, like delete can be replaced with standard library functions like Files.delete and getDirectoryEntries can be implemented using Files.list. I'm guessing that it's because this filesystem implementation had to support older Java versions. Does anyone have any objections to migrate or at least add an additional getNioPath method in addition to getIoFile that can be used by methods that operate on java.nio.file.Path instead of java.io.File?
--
You received this message because you are subscribed to the Google Groups "bazel-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to bazel-dev+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/bazel-dev/01658495-0a45-48e7-a36e-db4349f97478%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.