The current implementation of ggsave only worked for path variables that only had the deepest directory missing. I.e path=foo/bar would raise an exception if foo did not exist.
This PR allows for ggsave to create all missing directories in the path, meaning in the above example both foo and foo/bar would be created.
This PR also updates the file API code to use java.nio.file.* APIs, as well as the kotlin.io.path.* helpers/extensions.
The current implementation of
ggsave
only worked forpath
variables that only had the deepest directory missing. I.epath=foo/bar
would raise an exception iffoo
did not exist.This PR allows for
ggsave
to create all missing directories in the path, meaning in the above example bothfoo
andfoo/bar
would be created.This PR also updates the file API code to use
java.nio.file.*
APIs, as well as thekotlin.io.path.*
helpers/extensions.