Why can I not make a hard link to PkgInfo? With bash as my shell, a simple way to demonstrate my question is this:

mkdir -p foo.app/Contents
cd foo.app/Contents
echo -n 'AEgxFXTC' &gt; PkgInfo
ln PkgInfo f


The ln will fail with ln: f: Operation not permitted

I am on 10.10.5 with a Mac OS Extended (Journaled, Encrypted) file system.

There seems to be some magic squirreled away in the file system for files named PkgInfo inside a directory named Contents.  The contents of the file does not seem to matter.

What is the magic specifically?  Are there other magic names besides PkgInfo?  Why is it special?  etc.
This is an undocumented security "feature" of macOS. See https://groups.google.com/a/continuum.io/forum/#!topic/anaconda/CB0zClGfh3c


  This turns out to be an issue specific to *.app/Contents/PkgInfo and .app/Contents/Resources/.lproj files. OS X does not want to permit the creation of a hard link between one of these items in an application bundle to another file in a non-application-bundle folder. I was unable to find an explanation for this behavior in Apple's documentation, nor in the source code for HFS or the OS X kernel.