mirror of
https://github.com/MightyPirates/OpenComputers.git
synced 2025-09-13 01:10:19 -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()
|
deletions.clear()
|
||||||
|
|
||||||
def recurse(path: String) {
|
def recurse(path: String):Boolean = {
|
||||||
val directory = new io.File(fileRoot, path)
|
val directory = new io.File(fileRoot, path)
|
||||||
directory.mkdirs()
|
directory.mkdirs()
|
||||||
|
var dirChanged = false
|
||||||
for (child <- list(path)) {
|
for (child <- list(path)) {
|
||||||
val childPath = path + child
|
val childPath = path + child
|
||||||
if (isDirectory(childPath))
|
if (isDirectory(childPath))
|
||||||
recurse(childPath)
|
dirChanged = recurse(childPath) || dirChanged
|
||||||
else {
|
else {
|
||||||
val childFile = new io.File(fileRoot, childPath)
|
val childFile = new io.File(fileRoot, childPath)
|
||||||
val time = lastModified(childPath)
|
val time = lastModified(childPath)
|
||||||
@ -107,10 +108,14 @@ trait Buffered extends OutputStreamFileSystem {
|
|||||||
out.close()
|
out.close()
|
||||||
in.close()
|
in.close()
|
||||||
childFile.setLastModified(time)
|
childFile.setLastModified(time)
|
||||||
|
dirChanged = true
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if (dirChanged) {
|
||||||
directory.setLastModified(lastModified(path))
|
directory.setLastModified(lastModified(path))
|
||||||
|
true
|
||||||
|
} else false
|
||||||
}
|
}
|
||||||
if (list("") == null || list("").isEmpty) {
|
if (list("") == null || list("").isEmpty) {
|
||||||
fileRoot.delete()
|
fileRoot.delete()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user