RFR: 8373097: Save command should create missing parent directories
Jan Lahoda
jlahoda at openjdk.org
Wed Dec 17 07:08:51 UTC 2025
On Thu, 4 Dec 2025 18:08:56 GMT, Christian Stein <cstein at openjdk.org> wrote:
> Please review this change enhancing the `/save <file>` command in JShell to create missing parent directories.
>
> Prior to this change, when the <file> argument of a `/save` command starts with a list of directory names, of which at least one does not exist, the command fails with an exception reading:
>
> | File 'some/path/Snippet.java' for '/save' threw exception: java.nio.file.NoSuchFileException: some\path\Snippet.java
>
>
> Any exception happening during the creation of missing parent directories (using `Files.createDirectories` API) is caught and transformed into file-related error message.
Looks good to me, thanks!
-------------
Marked as reviewed by jlahoda (Reviewer).
PR Review: https://git.openjdk.org/jdk/pull/28662#pullrequestreview-3586310666
More information about the compiler-dev
mailing list