viirya commented on code in PR #51932:
URL: https://github.com/apache/spark/pull/51932#discussion_r2263857372
##########
common/utils/src/main/scala/org/apache/spark/util/SparkFileUtils.scala:
##########
@@ -134,6 +134,16 @@ private[spark] trait SparkFileUtils extends Logging {
createDirectory(root, namePrefix)
}
+ def createParentDirs(file: File): Unit = {
+ if (file == null) {
+ throw new IllegalArgumentException("Input should not be null.")
+ }
+ val parent = file.getParentFile()
+ if (parent != null) {
+ Files.createDirectories(parent.toPath())
Review Comment:
What's the difference between this and `parent.mkdirs()`?
Btw, should we handle the following like `com.google.common.io.Files`?
```
if (!parent.isDirectory()) {
throw new IOException("Unable to create parent directories of " +
file);
}
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]