sync with head
[gnome.introspection-doc-generator] / File.js
diff --git a/File.js b/File.js
index e788e59..29cff4a 100755 (executable)
--- a/File.js
+++ b/File.js
@@ -149,14 +149,23 @@ var File = {
         var dest = Gio.file_new_for_path(String(destPath));
         return dest.make_directory(null, null);
     },
         var dest = Gio.file_new_for_path(String(destPath));
         return dest.make_directory(null, null);
     },
-
-    copyFile : function (srcPath, destPath) {
+    /**
+     * copyFile
+     * @arg {String} src source path
+     * @arg {String} dest destination path
+     * @arg {Gio.FileCopyFlags} options (optional)  - use Gio.FileCopyFlags.OVERWRITE to .. overwrite..
+     * 
+     */
+    copyFile : function (srcPath, destPath, opts) {
+        if (typeof(opts) =='undefined') {
+            opts = Gio.FileCopyFlags.NONE
+        }
         var dest = Gio.file_new_for_path(String(destPath));
         var src = Gio.file_new_for_path(String(srcPath));
 
         // a bit of a hack for the fact that Gio.File.copy arguments
         // can be nulled, but not according to the GIR file
         var dest = Gio.file_new_for_path(String(destPath));
         var src = Gio.file_new_for_path(String(srcPath));
 
         // a bit of a hack for the fact that Gio.File.copy arguments
         // can be nulled, but not according to the GIR file
-        return src.copy(dest, Gio.FileCopyFlags.NONE);
+        return src.copy(dest, opts);
     },
 
     recursiveListing : function (dir) {
     },
 
     recursiveListing : function (dir) {