X-Git-Url: http://git.roojs.org/?p=gnome.introspection-doc-generator;a=blobdiff_plain;f=File.js;fp=File.js;h=29cff4aa295dfd22db0f66c66d27c4035567bb7d;hp=e788e59432df142837b3c9474ad80b6acc3f21ea;hb=6d14bc86faa68599bb5c2c6568ab738077b864dd;hpb=5428554f5a5952b050f99c8e4ebf9165ccf9dfbc diff --git a/File.js b/File.js index e788e59..29cff4a 100755 --- 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); }, - - 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 - return src.copy(dest, Gio.FileCopyFlags.NONE); + return src.copy(dest, opts); }, recursiveListing : function (dir) {