PDA

View Full Version : Why can directories be moved but not copied?


Wassercrats
03-16-2006, 04:30 AM
In CNC, I accidently moved a bunch of files and directories instead of copying them, so I went to their new location and tried to copy them to their old location, and I got an "Error copying files: 256." Copying just the files worked. Now I have to create and populate the directories one by one. Strange limitation for copying considering it's possible to move them all together.

Arthur
03-16-2006, 06:49 AM
The Copy Files and Move Files options were written to copy or move files, not directories. However, becausing moving files is the same as renaming files, as a side effect the Move option also works on directories. To copy directories, the files need to be copied recursively, for which the Copy option did not provide.

I have made some changes to the Copy Files option and it should now work properly on directories as well.

-Arthur

Tom E.
03-16-2006, 06:51 AM
If you haven't started yet, you could fire up telnet/ssh and do a recursive copy:cp -r SRC_DIR DEST_DIR

Wassercrats
03-16-2006, 07:08 AM
It was just a two minute job, so it's done. After I posted, I thought maybe the limitation is to prevent people from doubling the size of their website by accidently copying their root directory. Then I thought this was discussed before, but I couldn't find the post.

Wassercrats
03-25-2006, 10:07 AM
I wanted to mirror a directory in the same directory. Obviously, I'd have to give it a different name. There doesn't seem to be a one step way to do this in the CNC, so I tried copying the directory to a different directory, then I was going to rename it and copy it back to its original directory. Unfortunately, the directory I copied it to was one of its own subdirectories and a loop was created because CNC apparently doesn't go by the state of the directory at the time of the move. The subdirectories increased in number with each move, and the new subdirectories were seen as needing to be moved too. Something kicked in to limit this, but still...

Now I have to estimate how deep this is and decide whether I need to learn how to recursively delete the extras at the command line. :blah:

Wassercrats
03-25-2006, 10:31 AM
I'm FTPing them away, and my disk usage is dropping, but I'm getting "Could not remove directory. Directory not empty." messages. I'm not sure if that means I'll need another pass with my FTP software to delete the directories once the files are gone.

Earlier today I had to send out my yearly check to Futurequest and I was considering upgrading to a package with more disk space. I can't imagine how long it would take to delete those extra directories if I had a larger package. Still not done deleting after 10-15 minutes with DSL.