renaming a file with Server Side Actionscript on Linux
I'm trying to use this function of Adobe Media Server's Server Side Actionscript to rename a file.
On Windows I can do `renameTo("/relative/path/object.ext")` and it'll work fine.
However, when running the server on Linux, it gives me an error, and the rename operation will fail.
So I'm thinking that it's a problem between what each OS considers to be a relative or absolute path.
But regardless, how can I rename a file using this command on Linux?
my current code is this
Client.prototype.doSave = function(oldName,newName){
var thumbName = newName.replace("vid_","thumb_");
var oldSavedThumb = new File("/streams/_definst_/s3/"+thumbName+".png");
if(oldSavedThumb.exists){
trace("saving over thumb");
oldSavedThumb.remove();
}
var thumb = new File("/streams/_definst_/"+thumbName+"_temp.png");
if(thumb.exists){
if(!thumb.isOpen){
thumb.renameTo("/streams/_definst_/s3/"+thumbName+".png");
trace("thumb saved");
}else{
trace('thumb is open');
}
}else{
trace('thumb does not exist');
}
}
I get an error at the thumb.renameTo line. It works on Windows, just not on Linux.
this thread seems to detail a similar problem, but I can't decipher what the solution actually is.
