From d91c540d473fc12ca9e288fe351b138408dc5310 Mon Sep 17 00:00:00 2001 From: Kevin Sawicki Date: Thu, 7 Mar 2013 18:24:11 -0800 Subject: [PATCH] Remove $native.move() --- native/v8_extensions/native.mm | 16 +--------------- src/stdlib/fs.coffee | 2 +- 2 files changed, 2 insertions(+), 16 deletions(-) diff --git a/native/v8_extensions/native.mm b/native/v8_extensions/native.mm index 467ae48d8..7893f037a 100644 --- a/native/v8_extensions/native.mm +++ b/native/v8_extensions/native.mm @@ -26,7 +26,7 @@ namespace v8_extensions { const char* methodNames[] = { "absolute", "remove", "writeToPasteboard", "readFromPasteboard", "quit", "watchPath", "unwatchPath", - "getWatchedPaths", "unwatchAllPaths", "move", "moveToTrash", "reload", + "getWatchedPaths", "unwatchAllPaths", "moveToTrash", "reload", "md5ForPath", "getPlatform", "setWindowState", "getWindowState", "isMisspelled", "getCorrectionsForMisspelling" }; @@ -154,20 +154,6 @@ namespace v8_extensions { [pathWatcher unwatchAllPaths]; return true; } - else if (name == "move") { - NSString *sourcePath = stringFromCefV8Value(arguments[0]); - NSString *targetPath = stringFromCefV8Value(arguments[1]); - NSFileManager *fm = [NSFileManager defaultManager]; - - NSError *error = nil; - [fm moveItemAtPath:sourcePath toPath:targetPath error:&error]; - - if (error) { - exception = [[error localizedDescription] UTF8String]; - } - - return true; - } else if (name == "moveToTrash") { NSString *sourcePath = stringFromCefV8Value(arguments[0]); bool success = [[NSWorkspace sharedWorkspace] performFileOperation:NSWorkspaceRecycleOperation diff --git a/src/stdlib/fs.coffee b/src/stdlib/fs.coffee index 1bc2ff4d0..3fc6d88e1 100644 --- a/src/stdlib/fs.coffee +++ b/src/stdlib/fs.coffee @@ -81,7 +81,7 @@ module.exports = paths move: (source, target) -> - $native.move(source, target) + nodeFs.renameSync(source, target) # Remove a file at the given path. Throws an error if path is not a # file or a symbolic link to a file.