Watch out for mv command and symlinks on Samba shares

Nov 06, '03 10:02:00AM

Contributed by: prk

I just lost a full day's worth of work. Here is how you can too ... on a Samba share, do this:

 % mkdir something 
 % ln -s something something_else 
On Mac OS X in the shared directory, do this:
 % cd something_else 
 % touch test_file 
 % mv test_file ../something 
 mv: rename test_file to ../something/test_file: No such file or directory 
Watch it all go bye-bye.

I guess there are still bugs with the mv command. It should have said that the files were the same. If I realized that the directory that I was working in was a soft link to the main directory, I would not have tried to move the files.

[robg adds: Unix wizards, is this expected behavior out of mv? It seems wrong to me, but I don't know enough about what's normal in Unix...]

Comments (10)


Mac OS X Hints
http://hints.macworld.com/article.php?story=20031101012932535