Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

The file is used for storing layouts (show as icons/list/grid etc.) and various settings (sorting, grouping etc.).

Storing a local file inside the directory allows for moving that directory around while also keeping those settings.

The file is invisible for users of Finder so it is still the best solution for this task.

I have a .DS_Store line in a global .gitignore and don't notice it much but when I'm annoyed by DS_Store files in a specific directory, I usually bulk delete them using `fd`:

    fd -u --type file --fixed-strings .DS_Store $HOME/Projects/some-file-server-project -x echo rm {}


i'm surprised that Apple doesn't do directory-level metadata directly in the filesystem itself, e.g. with xattrs on the directory inode.


It does store that metadata in the directing in Mac OS native file systems. The DS files are only for non-Mac file systems like FAT32.


This is not true. My APFS volumes are absolutely littered with .DS_Stores. They're generated every time you open a directory in the Finder.


“Directory” not “Directing”




Consider applying for YC's Winter 2026 batch! Applications are open till Nov 10

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: