Created
March 4, 2014 09:07
-
-
Save notyy/9342843 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.io._ | |
def delDirNoRecur(dirName: String): Unit = { | |
val dir = new File(dirName) | |
if(dir.exists && dir.isDirectory){ | |
val files = dir.listFiles | |
files.foreach(_.delete()) | |
println(s"delete complete ${files.size} files deleted") | |
}else{ | |
println(s"$dirName not a directory") | |
} | |
} | |
delDirNoRecur("test") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment