Computer Science Canada

Copying files

Author:  smool [ Wed Nov 07, 2012 2:03 pm ]
Post subject:  Copying files

I wrote a program to copy some files for me automatically, except that whenever I use the the File.Copy proc, then put Error.LastMsg, it always says Access (permission) denied, and it doesn't copy anything. I tried copying to different directories on my computer, not using my C: drive, but always the same thing. How can i by-pass this?

Author:  mirhagk [ Wed Nov 07, 2012 10:56 pm ]
Post subject:  RE:Copying files

You could try use Sys.Exec and passing in command line commands for copying files, and seeing if that works

Author:  Tony [ Wed Nov 07, 2012 11:10 pm ]
Post subject:  RE:Copying files

do you actually have access to those files though? E.g. can your program read content from them?

Author:  mirhagk [ Wed Nov 07, 2012 11:37 pm ]
Post subject:  RE:Copying files

That's true, you only mentioned to tried different destinations, but you need to try different source files too. Even if you have permission (ie are admin) the file might be in use, or locked from something else etc. Make sure you can physically copy it yourself.


: