avoid setting last modified, if it is zero
This commit is contained in:
parent
e0671f01ce
commit
795a4ae3e3
2 changed files with 8 additions and 2 deletions
|
@ -320,7 +320,10 @@ class CopyMoveTask(
|
|||
|
||||
private fun updateLastModifiedValues(source: FileDirItem, destination: FileDirItem) {
|
||||
copyOldLastModified(source.path, destination.path)
|
||||
File(destination.path).setLastModified(File(source.path).lastModified())
|
||||
val lastModified = File(source.path).lastModified()
|
||||
if (lastModified != 0L) {
|
||||
File(destination.path).setLastModified(lastModified)
|
||||
}
|
||||
}
|
||||
|
||||
private fun deleteSourceFile(source: FileDirItem) {
|
||||
|
|
|
@ -38,7 +38,10 @@ fun BaseSimpleActivity.copySingleFileSdk30(source: FileDirItem, destination: Fil
|
|||
return if (source.size == copiedSize && getDoesFilePathExist(destination.path)) {
|
||||
if (baseConfig.keepLastModified) {
|
||||
copyOldLastModified(source.path, destination.path)
|
||||
File(destination.path).setLastModified(File(source.path).lastModified())
|
||||
val lastModified = File(source.path).lastModified()
|
||||
if (lastModified != 0L) {
|
||||
File(destination.path).setLastModified(lastModified)
|
||||
}
|
||||
}
|
||||
true
|
||||
} else {
|
||||
|
|
Loading…
Reference in a new issue