Skip to content

Instantly share code, notes, and snippets.

@dcposch
Created November 29, 2016 20:06
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dcposch/9df3455294d0b6dfe8b5bc6b88533752 to your computer and use it in GitHub Desktop.
Save dcposch/9df3455294d0b6dfe8b5bc6b88533752 to your computer and use it in GitHub Desktop.
really weird macOS bug

really weird macOS bug

reasonable behavior on linux

dc@dc:/tmp$ mkdir foo
dc@dc:/tmp$ echo sup > foo/1
dc@dc:/tmp$ echo dawg > foo/2
dc@dc:/tmp$ echo yo > bar
dc@dc:/tmp$ cp -r foo/ bar
cp: cannot overwrite non-directory ‘bar’ with directory ‘foo/’
dc@dc:/tmp$ cat bar
yo

wrong behavior on macOS

DCs-MacBook:tmp dc$ mkdir foo
DCs-MacBook:tmp dc$ echo sup > foo/1
DCs-MacBook:tmp dc$ echo dawg > foo/2
DCs-MacBook:tmp dc$ echo yo > bar
DCs-MacBook:tmp dc$ cp -r foo/ bar
cp: bar: Not a directory
DCs-MacBook:tmp dc$ cat bar
dawg

macOS sierra x64 running on a 2016 12” macbook

can it really be that cp on a mac is that buggy??

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment