5

In my home directory, there are two files called ._Desktop and ._Library. They have read and write permissions, but cannot be read, even with root.

What do these files do? Is there any way to modify them?

9
  • What dos you mean cannot be read? What does ls -l on them show
    – mmmmmm
    Jun 1, 2016 at 23:20
  • ls -l shows -rwx------, but even sudo cat ._Desktop returns permission denied.
    – Dan
    Jun 1, 2016 at 23:21
  • ls -l shows more than that
    – mmmmmm
    Jun 1, 2016 at 23:23
  • 3
    I was guessing already, but apple.stackexchange.com/questions/240340/… gives it away... Is your Home folder not on an HFS+ drive on a Mac? If it's on a networked drive, any file with a resource fork will have an associate dot underscore file.
    – Tetsujin
    Jun 2, 2016 at 5:44
  • 2
    Then that's why those files exist, they hold data that only HFS+ can hold in a single file. Best to leave them well alone. If you copy the 'real' files back to a Mac, that data will again be merged. I think in most cases they are not absolutely vital (but don't quote me;) - but the Mac is still capable of using them in the split AppleDouble format on a remote volume. afaik, if you delete them, they get regenerated every time the Mac deals with the file.
    – Tetsujin
    Jun 2, 2016 at 8:33

1 Answer 1

5

._ Desktop and ._Library contain extended attributes for these directories. This StackOverflow question describes roughly what generic ._ files are.

if for file foo you have another ._foo, and you're on a Mac, the dot-underscore file is where the file resource fork / metadata is kept.

As to why directories like Desktop or Library would need extended attributes is beyond me, though I would guess it has something to do with appearance and special files.


If these ._ files are appearing on a mounted network filesystem (i.e. NFS) that doesn't use HFS+ on the host server, that is because HFS+ would usually store the information found inside these ._ files along with the file itself. However, since other filesystems do not handle these extended attributes nicely, OS X creates a resource fork that allows your client-side HFS+ filesystem to see extended attributes as if they were part of the file itself.

These files are used in the AppleDouble format which cause the file itself and its pesky counterpart to be merged once the file is taken off the networked filesystem and placed onto a HFS+ filesystem. Deleting these ._file metadata counterparts would usually result in their regeneration the next time OS X processes the file itself.

credit to Tetsujin's comment

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .