简体   繁体   中英

Opening symlink to .txt file results in permission denied on MAC OS X

Assume I have two folders and a .txt file in a directory such that

/folder1/file.txt
/folder2

Being currently in folder1 I create a symlink with ln -s file.txt ../folder2/ . If a now cd into folder2 and open the symbolic link in vim with vim file.txt the editor opens with an empty file prompting "test.txt" [Permission Denied] in the status bar. Additionally the file only open in "readonly" mode. Is there a way to create a working symlink. I am on Mac OS X.

Update: ls -lR on the original file results in -rw-r--r-- and for the symlink I obtain lrwxr-xr-x .

I would suggest trying to enter the complete path to the target. eg

ln -s /folder1/file.txt ../folder2/ 

The path to the link can be relative.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM