mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-12-04 02:57:38 +00:00
Adding a rename test.
This commit is contained in:
parent
ae30ecbdf8
commit
fcb973ff92
@ -1,6 +1,28 @@
|
||||
const nsILocalFile = Components.interfaces.nsILocalFile;
|
||||
var prefix = "";
|
||||
|
||||
function rename(source, newName)
|
||||
{
|
||||
try {
|
||||
var sourceFile = Components.classes["component://mozilla/file/local"].
|
||||
createInstance(nsILocalFile);
|
||||
sourceFile.initWithPath(source);
|
||||
|
||||
}
|
||||
catch (e) {
|
||||
dump("Could not create nsILocalFile\n");
|
||||
}
|
||||
|
||||
|
||||
try {
|
||||
sourceFile.copyTo(null, newName);
|
||||
}
|
||||
catch (e) {
|
||||
dump("error coping" + e + "\n");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
function cp(source, dest, followLinks, newName)
|
||||
{
|
||||
try {
|
||||
|
Loading…
Reference in New Issue
Block a user