From f62c0b4ca830d0b52f3c87dad1ef96001f804b51 Mon Sep 17 00:00:00 2001 From: Sebastian Stenzel Date: Sat, 29 Apr 2017 10:12:39 +0200 Subject: [PATCH] Create non-existing parent directories of IPC port file. --- .../java/org/cryptomator/launcher/InterProcessCommunicator.java | 1 + 1 file changed, 1 insertion(+) diff --git a/main/launcher/src/main/java/org/cryptomator/launcher/InterProcessCommunicator.java b/main/launcher/src/main/java/org/cryptomator/launcher/InterProcessCommunicator.java index e0b3af685..3c77aadf0 100644 --- a/main/launcher/src/main/java/org/cryptomator/launcher/InterProcessCommunicator.java +++ b/main/launcher/src/main/java/org/cryptomator/launcher/InterProcessCommunicator.java @@ -221,6 +221,7 @@ abstract class InterProcessCommunicator implements InterProcessCommunicationProt ByteBuffer buf = ByteBuffer.allocate(Integer.BYTES); buf.putInt(port); buf.flip(); + Files.createDirectories(path.getParent()); try (WritableByteChannel ch = Files.newByteChannel(path, StandardOpenOption.WRITE, StandardOpenOption.CREATE, StandardOpenOption.TRUNCATE_EXISTING)) { if (ch.write(buf) != Integer.BYTES) { throw new IOException("Did not write expected number of bytes.");