mirror of
https://github.com/MightyPirates/OpenComputers.git
synced 2025-09-12 16:57:32 -04:00
Only change date of directory modification if it actually changed.
(cherry picked from commit c463df0)
This commit is contained in:
parent
2256adf30c
commit
db18c1df62
@ -88,13 +88,14 @@ trait Buffered extends OutputStreamFileSystem {
|
||||
}
|
||||
deletions.clear()
|
||||
|
||||
def recurse(path: String) {
|
||||
def recurse(path: String):Boolean = {
|
||||
val directory = new io.File(fileRoot, path)
|
||||
directory.mkdirs()
|
||||
var dirChanged = false
|
||||
for (child <- list(path)) {
|
||||
val childPath = path + child
|
||||
if (isDirectory(childPath))
|
||||
recurse(childPath)
|
||||
dirChanged = recurse(childPath) || dirChanged
|
||||
else {
|
||||
val childFile = new io.File(fileRoot, childPath)
|
||||
val time = lastModified(childPath)
|
||||
@ -107,10 +108,14 @@ trait Buffered extends OutputStreamFileSystem {
|
||||
out.close()
|
||||
in.close()
|
||||
childFile.setLastModified(time)
|
||||
dirChanged = true
|
||||
}
|
||||
}
|
||||
}
|
||||
directory.setLastModified(lastModified(path))
|
||||
if (dirChanged) {
|
||||
directory.setLastModified(lastModified(path))
|
||||
true
|
||||
} else false
|
||||
}
|
||||
if (list("") == null || list("").isEmpty) {
|
||||
fileRoot.delete()
|
||||
|
Loading…
x
Reference in New Issue
Block a user