moving files with mv

Top Page
Attachments:
Message as email
+ (text/plain)
Delete this message
Reply to this message
Author: Kurt Granroth
Date:  
Subject: moving files with mv
On Friday 15 August 2003 09:19 am, Craig White wrote:
> I'm gathering that you are saying that my problem last time was with the
> 'cp' command and it shouldn't have (or wouldn't have) happened if I had
> 'mv' the files instead - is that it?


Actually, no. Moving files from one filesystem to another is almost identical
to doing a copy and delete. I was briefly thinking that you were copying
directories within the same filesystem that time. In that case, a 'mv' is
much better than 'cp' since all it does is manipulate the inodes internally
and doesn't actually copy any data.

That said, I'm nearly 100% sure that you didn't lose your Mac files because of
invalid characters in the filename. If there were invalid chars, then 'cp'
would simply not deal with file at all since it wouldn't even recognize it.
There has to be something else going on.

My guess is that there was an issue with Mac "resources." Macintosh files can
have certain resources attached to them that the MacOS recognizes just fine
(and hides from the end user) but that the Linux implementation of the
filesystem didn't correctly identify. In that case, when you copied over
your Mac files, the resources didn't get copied and MacOS saw them
(correctly) as corrupted.

Since Windows has no such concept, that's not an issue here.

> This time, I am on the same filesystem so I would expect a whole lot
> less trouble whereas the time I lost some files, I was moving the files
> from one hard drive to another.
>
> Tar does seem safer...


'tar' would definitely work in this case. Mind you, it might not have helped
in the MacOS case, though, depending on how the resources were presented in
the filesystem.