Skip to content

Commit

Permalink
Solaris automounter: createDirectories throws FileSystemException, fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
mattirn committed Aug 29, 2020
1 parent e7eb5e0 commit 949969e
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,10 @@ public void save() throws IOException {
private void internalWrite(Path path, int from) throws IOException {
if (path != null) {
Log.trace("Saving history to: ", path);
Files.createDirectories(path.toAbsolutePath().getParent());
Path parent = path.toAbsolutePath().getParent();
if (!Files.exists(parent)) {
Files.createDirectories(parent);
}
// Append new items to the history file
try (BufferedWriter writer = Files.newBufferedWriter(path.toAbsolutePath(),
StandardOpenOption.WRITE, StandardOpenOption.APPEND, StandardOpenOption.CREATE)) {
Expand Down

0 comments on commit 949969e

Please sign in to comment.