GithubHelp home page GithubHelp logo

Comments (8)

bchallenor avatar bchallenor commented on July 18, 2024

Version is 0.4.2.

from memoryfilesystem.

marschall avatar marschall commented on July 18, 2024

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.

bchallenor avatar bchallenor commented on July 18, 2024

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.

bchallenor avatar bchallenor commented on July 18, 2024

Please could you push to Maven?

from memoryfilesystem.

marschall avatar marschall commented on July 18, 2024

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.

bchallenor avatar bchallenor commented on July 18, 2024

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.

marschall avatar marschall commented on July 18, 2024

Sorry I didn't answer for such a long time. The issue is that SingletonPath is always absolute and never relative.

from memoryfilesystem.

marschall avatar marschall commented on July 18, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.