You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
There only exists createDirectories but not a singular createDirectory. A singular createDirectory operation has the beneficial feature of a built in assertion that the parent folder already exists. Currently, I work round this with something like:
fun FileSystem.createDirectory(path:Path, mustCreate:Boolean = true) {
check(exists(path.parent!!))
createDirectories(path,mustCreate=mustCreate)
}
This is not ideal becasuse the operation now involves two IO instructions, when I would expect this to be a single IO instruction.
Is there a technical reason why this is difficult to implement, or is it by design?
The text was updated successfully, but these errors were encountered:
No technical reasons not to have such a method (in fact, createDirectories creates directories one by one while climbing up parent paths chain). Current FS support was not properly designed, so it consists of some more or less randomly selected functions.
There only exists
createDirectories
but not a singularcreateDirectory
. A singularcreateDirectory
operation has the beneficial feature of a built in assertion that the parent folder already exists. Currently, I work round this with something like:This is not ideal becasuse the operation now involves two IO instructions, when I would expect this to be a single IO instruction.
Is there a technical reason why this is difficult to implement, or is it by design?
The text was updated successfully, but these errors were encountered: