‹ BackHN Continuity

Thread

cp: -r or -R?

126 points · 110 comments · zdw

  1. bariumbitmap · · focus · HN ↗
    This blog post is odd because it keeps on hinting about a difference between `-r' and `-R' and links to the source code but never actually says what it is. I'll quote the OpenBSD manual that the post mentions but does not link to for some reason:

    > Historic versions of the cp utility had an -r option. This implementation supports that option; however, its use is strongly discouraged, as it does not correctly copy special files, symbolic links or FIFOs.

    <a href="https:&#x2F;&#x2F;man.openbsd.org&#x2F;cp" rel="nofollow">https:&#x2F;&#x2F;man.openbsd.org&#x2F;cp

    1. embedding-shape · · focus · HN ↗
      &gt; links to the source code but never actually says what it is.

      The snippet of code makes it very clear what the difference is, no?

      flag_copy_as_regular = 1 VS flag_copy_as_regular = 0, where regular would be a &quot;regular&quot; and not &quot;special&quot; file.

      1. wodenokoto · · focus · HN ↗
        That’s for gnu implementation. For the BSD implementation author just links to the source code.
Open on Hacker News to reply ↗

Unofficial Hacker News client; not affiliated with Y Combinator.