Question
File.CopyTo across servers
I need to copy recorded streams from server to server. I
planned on using the File.CopyTo function, but I have two
questions.
First, the PDF documentation of the server side actionscript states that "If ... the destination file doesn’t exist, the operation
fails..." (pg 70.) Do I first need to create the destination file by opening it in "create" mode before using the CopyTo function?
Second, I am assuming that I should be able to use the file naming convention "//server/app/dir/filename" for the destination file to copy the file from server A to server B using the mapped locations. But something's nagging at me telling me this won't work. In the documentation the naming instructions kind of imply that file copies only work within a single server. The example doesn't show either an app name or server. I want to do this:
Code running on source server.
var fileToCopy = new File("/dir/filename");
fileToCopy .CopyTo("//destserver/app/dir/filename")
If that's no good, can I copy the file from the source server to the destination server from the destination app? For instance:
Code running on destination server.
var fileToCopy = new File("//srcserver/app/dir/filename");
fileToCopy .CopyTo("/dir/filename")
If someone could clarify this for me I'd appreciate it.
Thanks.
First, the PDF documentation of the server side actionscript states that "If ... the destination file doesn’t exist, the operation
fails..." (pg 70.) Do I first need to create the destination file by opening it in "create" mode before using the CopyTo function?
Second, I am assuming that I should be able to use the file naming convention "//server/app/dir/filename" for the destination file to copy the file from server A to server B using the mapped locations. But something's nagging at me telling me this won't work. In the documentation the naming instructions kind of imply that file copies only work within a single server. The example doesn't show either an app name or server. I want to do this:
Code running on source server.
var fileToCopy = new File("/dir/filename");
fileToCopy .CopyTo("//destserver/app/dir/filename")
If that's no good, can I copy the file from the source server to the destination server from the destination app? For instance:
Code running on destination server.
var fileToCopy = new File("//srcserver/app/dir/filename");
fileToCopy .CopyTo("/dir/filename")
If someone could clarify this for me I'd appreciate it.
Thanks.
