I thought I’ll make this thread for all of you out there who have questions but are afraid to ask them. This is your chance!

I’ll try my best to answer any questions here, but I hope others in the community will contribute too!

  • @vort3@lemmy.ml
    link
    fedilink
    08 months ago

    How do symlinks work from the point of view of software?

    Imagine I have a file in my downloads folder called movie.mp4, and I have a symlink to it in my home folder.

    Whenever I open the symlink, does the software (player) understand «oh this file seems like a symlink, I should go and open the original file», or it’s a filesystem level stuff and software (player) basically has no idea if a file I’m opening is a symlink or the original movie.mp4?

    Can I use sync software (like Dropbox, Gdrive or whatever) to sync symlinks? Can I use sync software to sync actual files, but only have symlinks in my sync folder?

    Is there a rule of thumb to predict how software behaves when dealing with symlinks?

    I just don’t grok symbolic links.

    • CyclohexaneOPM
      link
      fedilink
      08 months ago

      A symlink works more closely to the first way you described it. The software opening a symlink has to actually follow it. It’s possible for a software to not follow the symlink (either intentionally or not).

      So your sync software has to actually be able to follow symlinks. I’m not familiar with how gdrive and similar solutions work, but I know this is possible with something like rsync

      • @vort3@lemmy.ml
        link
        fedilink
        18 months ago

        So I guess it’s something like pressing ctrl+c: most software doesn’t specifically handle this hotkey so in general it will interrupt a running process, but software can choose to handle it differently (like in vim ctrl+C does not interrupt it).

        Thanks.

        Fun fact: pressing X (close button) on a window does not make it that your app is closed, it just sends a signal that you wish to close it, your app can choose what to do with this signal.