[TxMt] Symlinks and permissions?

Steve King sking at arbor.net
Tue Mar 3 19:22:37 UTC 2009


I just found a problem with TextMate and symlinks.  Say I have a regular
file and a symlink to that file. If I open the symlink in TextMate and
save it again, the original file's permissions are changed to those of
the symlink.  My umask is set to 0022, so files are created 0644
(rw-r--r--) and directories are created 0755 (rwxr-xr-x). Symlinks are
created with permissions as if they were directories. The end result of
all of this is that if I edit a symlink to a file, the file ends up
getting its execute bits set.

Is there any way to keep this from happening? I don't really want to go
around setting execute permission on arbitrary text files...

    MariMac:/tmp/test$ umask
    0022
    MariMac:/tmp/test$ echo "hello world" > foo
    MariMac:/tmp/test$ ln -s foo bar
    MariMac:/tmp/test$ ls -l
    total 8
    lrwxr-xr-x 1 sking wheel  3 2009-03-03 14:10 bar -> foo
    -rw-r--r-- 1 sking wheel 12 2009-03-03 14:10 foo
    MariMac:/tmp/test$ mate -w bar
    MariMac:/tmp/test$ ls -l
    total 8
    lrwxr-xr-x 1 sking wheel  3 2009-03-03 14:10 bar -> foo*
    -rwxr-xr-x 1 sking wheel 24 2009-03-03 14:11 foo*

(Obviously I have "Perform atomic saves" unchecked in the preferences,
otherwise the symlink would get overwritten and the original file
wouldn't be changed.)

-- 
Steve King
Sr. Software Engineer
Arbor Networks
+1 734 821 1461
www.arbornetworks.com <http://www.arbornetworks.com/>




More information about the textmate mailing list