[Unix][C] Similarities between Unix symlinks and C/C++ pointers/references

Sometimes you want to copy symlink, sometimes you want to 'dereference' symlink.

man cp:

       -L, --dereference
              always follow symbolic links in SOURCE
...
       -P, --no-dereference
              never follow symbolic links in SOURCE

man rsync:

       --links, -l              copy symlinks as symlinks
       --copy-links, -L         transform symlink into referent file/dir

Midnight commander has the 'follow links' option.

You see the difference?

In programming, sometimes it's enough to copy only a pointer to object, sometimes an object itself is to be copied.

Pure C and C++ programmers also use the 'dereference' term, meaning: get an object by pointer.

(the post first published at 20251204.)


List of my other blog posts.

Subscribe to my news feed,

Some time ago (before 24-Mar-2025) there was Disqus JS script for comments. I dropped it --- it was so motley, distracting, animated, with too much ads. I never liked it. Also, comments din't appeared correctly (Disqus was buggy). Also, my blog is too chamberlike --- not many people write comments here. So I decided to switch to the model I once had at least in 2020 --- send me your comments by email (don't forget to include URL to this blog post) and I will copy&paste it here manually.

Let's party like it's ~1993-1996, in this ultimate, radical and uncompromisingly primitive pre-web1.0-style blog and website. This website is best viewed under lynx/links/elinks/w3m.