kittyoung
V2EX  ›  macOS

osx 的 Containers 软链接很感人

  •  
  •   kittyoung · Oct 15, 2015 · 2019 views
    This topic created in 3866 days ago, the information mentioned may be changed or developed.
    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 replies    2015-10-20 14:24:42 +08:00
    MartinWu
        1
    MartinWu  
       Oct 16, 2015
    相对路径一个好处就是整个 Containers 变动了位置,也不会影响软链。
    kittyoung
        2
    kittyoung  
    OP
       Oct 16, 2015
    @MartinWu 可以举例说明吗
    MartinWu
        3
    MartinWu  
       Oct 20, 2015
    @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 目录,你就只能重建软链接了。
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   986 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 34ms · UTC 19:12 · PVG 03:12 · LAX 12:12 · JFK 15:12
    ♥ Do have faith in what you're doing.