|
@@ -108,13 +108,26 @@ class NCUtilityFileSystem: NSObject {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- @objc func moveFile(atPath: String, toPath: String) {
|
|
|
+ @objc func moveFile(atPath: String, toPath: String) -> Bool {
|
|
|
|
|
|
- if atPath == toPath { return }
|
|
|
+ if atPath == toPath { return true }
|
|
|
|
|
|
- try? FileManager.default.removeItem(atPath: toPath)
|
|
|
- try? FileManager.default.copyItem(atPath: atPath, toPath: toPath)
|
|
|
- try? FileManager.default.removeItem(atPath: atPath)
|
|
|
+ do {
|
|
|
+ try FileManager.default.removeItem(atPath: toPath)
|
|
|
+ }
|
|
|
+ catch {
|
|
|
+ print(error)
|
|
|
+ }
|
|
|
+
|
|
|
+ do {
|
|
|
+ try FileManager.default.copyItem(atPath: atPath, toPath: toPath)
|
|
|
+ try FileManager.default.removeItem(atPath: atPath)
|
|
|
+ return true
|
|
|
+ }
|
|
|
+ catch {
|
|
|
+ print(error)
|
|
|
+ return false
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
@objc func moveFileInBackground(atPath: String, toPath: String) {
|