views:

830

answers:

2

My folder Structure

/UNIX
    /Find
    /Grep
    /Find-Grep

I made a symlink to the UNIX folders unsuccessfully by

ln -s /I/Unix path/Dropbox/myFriend

I removed a .todo -file at /Dropbox/myFriend/Unix/Find/.todo. I noticed that that my .todo file at /I/Unix/Find was also removed.

How can you make a symlink such that my friend can see my files but he cannot remove my them in my computer?

[edit]

The first problem is solved: we can create a recursive symlink.

However, we have not found a method not to allow my friend to delete my files in my computer too, when we use Symlinks in Dropbox.

+3  A: 

Change the permissions on the file/s so that he does not have group, or other, write access.

You could do:

chmod g-w,o-w -R /I/UNIX/
crb@server ~ $ ls -l test/dir
total 0
-rwxrwxrwx 1 crb crb 0 2009-04-14 10:35 example-file
crb@server ~ $ chmod g-w,o-w -R test/dir
crb@server ~ $ ls -l test/dir
total 0
-rwxr-xr-x 1 crb crb 0 2009-04-14 10:35 example-file
crb
Your suggestion seems to be dangerous if my friend is able to change file permissions by himself - he could delete all my notes then. @crb: the code should be $ chmod -R g-w,o-w /I/UNIX/
Masi
AFAIK, your friend cannot change the permissions, unless he's root or owner of the file.
jpalecek
It seems that the same command with numbers in chmod is, $ chmod -R 755 Unix
Masi
@jpacelek: I tested the code with above permissions. My friend can delete my files.
Masi
Here is a handy pointer: http://www.aota.net/Script_Installation_Tips/changemode.php4. Start another question asking why your friend can delete your files, with a directory listing, if you need.
crb
Your friend can only delete your files, if he has write permission to their directory.
jpalecek
+3  A: 

I was going to suggest remounting the directory bind,ro

mount -o bind,ro /I/Unix /Dropbox/myFriend

but it seems that functionality isn't in the kernel yet. Might be in yours, but not in my ubuntu box. So, alternately (instead of changing the permissions on all of your files) you could export the directory to nfs as read-only.

Eddy
Thank you for letting me know about the mounting!
Masi