Comments (8)
Version is 0.4.2.
from memoryfilesystem.
There are more things wrong with symlinks. I'll make a release (0.6.0) that fixes this issue but fixing the rest will take more time.
from memoryfilesystem.
Thanks! BTW I mistakenly thought 0.4.2 was latest because it appears at the top of the tag list. You might want to rename the tags to all have the same format (unless it would break legacy things).
from memoryfilesystem.
Please could you push to Maven?
from memoryfilesystem.
It is in Maven Central http://search.maven.org/#artifactdetails|com.github.marschall|memoryfilesystem|0.6.0|bundle
The third line in the Readme that is displayed on the project home page has the current version in the XML for copy and pasting into your pom.
I don't know how I feel about renaming the tags. You have a point on the other hand "tags are forever".
from memoryfilesystem.
Confirmed the original test case is fixed in 0.6.0, thanks. Is there any chance you could fix a very similar case but with a relative instead of absolute link target? I believe this should be resolved relative to the link's parent directory. Here is a repro:
private static void test_0_6_0() throws IOException {
final FileSystem fileSystem = MemoryFileSystemBuilder.newLinux().build("1");
final List<String> lines = new ArrayList<>();
lines.add("Hello world");
final Path filePath = fileSystem.getPath("/").resolve("file");
Files.write(filePath, lines, StandardCharsets.UTF_8);
final Path linkPath = filePath.resolveSibling("link");
// should be resolved relative to the link's parent directory
Files.createSymbolicLink(linkPath, filePath.getFileName());
final List<String> lines1 = Files.readAllLines(linkPath, StandardCharsets.UTF_8);
System.out.println(lines1);
}
Exception in thread "main" java.nio.file.NoSuchFileException: file
at com.github.marschall.memoryfilesystem.MemoryFileSystem$1.value(MemoryFileSystem.java:335)
at com.github.marschall.memoryfilesystem.MemoryFileSystem$1.value(MemoryFileSystem.java:306)
at com.github.marschall.memoryfilesystem.MemoryFileSystem$11.value(MemoryFileSystem.java:604)
at com.github.marschall.memoryfilesystem.MemoryFileSystem.withLockDo(MemoryFileSystem.java:656)
at com.github.marschall.memoryfilesystem.MemoryFileSystem.withWriteLockOnLastDo(MemoryFileSystem.java:597)
at com.github.marschall.memoryfilesystem.MemoryFileSystem.getFile(MemoryFileSystem.java:306)
at com.github.marschall.memoryfilesystem.MemoryFileSystem.access$300(MemoryFileSystem.java:62)
at com.github.marschall.memoryfilesystem.MemoryFileSystem$1.value(MemoryFileSystem.java:343)
at com.github.marschall.memoryfilesystem.MemoryFileSystem$1.value(MemoryFileSystem.java:306)
at com.github.marschall.memoryfilesystem.MemoryFileSystem$11.value(MemoryFileSystem.java:604)
at com.github.marschall.memoryfilesystem.MemoryFileSystem.withLockDo(MemoryFileSystem.java:624)
at com.github.marschall.memoryfilesystem.MemoryFileSystem.withWriteLockOnLastDo(MemoryFileSystem.java:597)
at com.github.marschall.memoryfilesystem.MemoryFileSystem.getFile(MemoryFileSystem.java:306)
at com.github.marschall.memoryfilesystem.MemoryFileSystem.newInputStream(MemoryFileSystem.java:266)
at com.github.marschall.memoryfilesystem.MemoryFileSystemProvider.newInputStream(MemoryFileSystemProvider.java:248)
at java.nio.file.Files.newInputStream(Files.java:106)
at java.nio.file.Files.newBufferedReader(Files.java:2666)
at java.nio.file.Files.readAllLines(Files.java:2999)
at test.Main.test_0_6_0(Main.java:44)
at test.Main.main(Main.java:13)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:601)
at com.intellij.rt.execution.application.AppMain.main(AppMain.java:134)
from memoryfilesystem.
Sorry I didn't answer for such a long time. The issue is that SingletonPath
is always absolute and never relative.
from memoryfilesystem.
I created #35 to track the issue since it's a different one. I fixed it and released it as 0.6.1 and deployed it to Maven central. It should become available within the next few hours. Again sorry for the delay.
from memoryfilesystem.
Related Issues (20)
- Implement FileSystemProvider#deleteIfExists
- Removing all FilePermissions leaves the file still read and writeable HOT 3
- Implement JUnit extension for @CompatibilityTest
- MemoryFileSystem::newOutputFileStream does not check the path it opens for write permissions HOT 4
- Is it possible to use MemoryFileSystem as the default FileSystem? HOT 3
- Support Jakarta EE
- Path.touri().getPath() returns null HOT 7
- Support URLs HOT 6
- Module descriptor or module name seems to have gone away HOT 4
- Verify MemoryInode.writeFully handles overflow
- Infinite loop on #transferFrom underflow
- Consider introducing a Flags abstraction
- Validate invalid open options combinations
- Implement header support for URLConnection
- Files.setPosixFilePermissions throws UnsupportedOperationException HOT 3
- Relative paths in symlinks not correctly resolved
- newInputStream and newOutputStream are not atomic
- macOS paths no longer normalised to NFD
- Solution or workaround for nested zip/jar files? HOT 2
- Wrong index referenced in exception message for subpath HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from memoryfilesystem.