Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

java.nio.file.Files.createDirectories throws Operation not applicable #559

Closed
tomasjura opened this issue Jul 29, 2020 · 0 comments
Closed
Milestone

Comments

@tomasjura
Copy link

There is an issue in the java.nio.file.Files.createDirectories which fails for a home dir which is mounted using automounter on Solaris. It raises

java.nio.file.FileSystemException: /users/john: Operation not applicable
        at sun.nio.fs.UnixException.translateToIOException(UnixException.java:91)
        at sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:102)
        at sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:107)
        at sun.nio.fs.UnixFileSystemProvider.createDirectory(UnixFileSystemProvider.java:384)
        at java.nio.file.Files.createDirectory(Files.java:674)
        at java.nio.file.Files.createAndCheckIsDirectory(Files.java:781)
        at java.nio.file.Files.createDirectories(Files.java:767)
        at org.jline.reader.impl.history.DefaultHistory.internalWrite(DefaultHistory.java:229)

...

The patch is:

jline3/reader/src/main/java/org/jline/reader/impl/history/DefaultHistory.java:229
- Files.createDirectories(path.toAbsolutePath().getParent());
+ Path parent=path.toAbsolutePath().getParent();
+ if (! Files.exists(parent) ) Files.createDirectories(parent);
@mattirn mattirn added this to the 3.16.1 milestone Aug 29, 2020
@mattirn mattirn mentioned this issue Oct 15, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants