V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
kittyoung
V2EX  ›  macOS

osx 的 Containers 软链接很感人

  •  
  •   kittyoung · 2015-10-15 22:24:03 +08:00 · 1520 次点击
    这是一个创建于 3143 天前的主题,其中的信息可能已经有所发展或是发生改变。
    ll ~/Library/Containers/com.apple.AddressBook/Data/Library/Application\ Support
    total 24
    drwx------ 5 host staff 170 10 11 19:24 ./
    drwx------ 29 host staff 986 10 11 19:24 ../
    lrwxr-xr-x 1 host staff 46 10 11 19:24 AddressBook@ -> ../../../../../Application Support/AddressBook
    lrwxr-xr-x 1 host staff 47 10 11 19:24 SyncServices@ -> ../../../../../Application Support/SyncServices
    lrwxr-xr-x 1 host staff 41 10 11 19:24 iCloud@ -> ../../../../../Application Support/iCloud

    why not ~/Library/Application Support/ ???
    3 条回复    2015-10-20 14:24:42 +08:00
    MartinWu
        1
    MartinWu  
       2015-10-16 15:15:55 +08:00
    相对路径一个好处就是整个 Containers 变动了位置,也不会影响软链。
    kittyoung
        2
    kittyoung  
    OP
       2015-10-16 18:45:45 +08:00
    @MartinWu 可以举例说明吗
    MartinWu
        3
    MartinWu  
       2015-10-20 14:24:42 +08:00
    @kittyoung 例如我在一个目录 S 下面有两个 shell 脚本, A.sh 然后 ln -s ./A.sh B.sh 。 现在 S 是放在 /home/xx 下,我可以直接 bash /home/xx/S/B.sh 。然后现在 S 换个目录 ,放到 /tmp 下。那我还是 bash /tmp/S/B.sh 没问题。 但是如果你一开始 是 ln -s /home/xx/S/A.sh B.sh ,后面换到 /tmp 目录,你就只能重建软链接了。
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   实用小工具   ·   3315 人在线   最高记录 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 27ms · UTC 00:48 · PVG 08:48 · LAX 17:48 · JFK 20:48
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.