Live data from Hacker News

Parsing the .DS_Store File Format (2018)

0day.work

1–10 of 91 posts

Re: Parsing the .DS_Store File Format (2018)

#2
>>Apple's operating system creates this file in apparently all directories to store meta information about its contents. In fact, it contains the names of all files (and also directories) in that folder.

Anyone have an idea why modern versions of MacOS still uses a .DS_Store file? The OS could just as easily read and display the contents of a directory. And deleting a .DS_Store file doesn't seem to have any noticeable negative affect.

Re: Parsing the .DS_Store File Format (2018)

#4
post #2

>>Apple's operating system creates this file in apparently all directories to store meta information about its contents. In fact, it contains the names of all files (and also directories) in that folder. Anyone have an idea why modern versions of MacOS still uses a .DS_Store file? The OS could just as easily read and display the contents of a directory. And deleting a .DS_Store file doesn't seem to have any noticeabl…

I believe if you've dragged some files around in that folder, it stores where those were. Or if you've set the folder to sort by name or date modified, etc.

Re: Parsing the .DS_Store File Format (2018)

#5

Curious what creative use cases people have around this bizarre file format. The only reason myself and millions of other people have to deal with this stupid file is adding it to .gitignore as part of the ritual of spinning up a new codebase

nitpick: As it’s a platform and machine specific thing, technically it shouldn’t be in .gitignore but in .git/info/exclude

People working on Linux or Windows do not need to know about garbage your dev env leaves on your machine.

I’m saying this half-seriously as I fully understand that these are so common, it’s more convenient to have the exclusion synced between clones.

That said, as a purist, none of the repos I’m watching over have .DS_Store in their gitignore

Re: Parsing the .DS_Store File Format (2018)

#6
post #2

>>Apple's operating system creates this file in apparently all directories to store meta information about its contents. In fact, it contains the names of all files (and also directories) in that folder. Anyone have an idea why modern versions of MacOS still uses a .DS_Store file? The OS could just as easily read and display the contents of a directory. And deleting a .DS_Store file doesn't seem to have any noticeabl…

> Anyone have an idea why modern versions of MacOS still uses a .DS_Store file?

The Wikipedia article is a pretty good resource for this: https://en.wikipedia.org/wiki/.DS_Store

Re: Parsing the .DS_Store File Format (2018)

#7
post #2

>>Apple's operating system creates this file in apparently all directories to store meta information about its contents. In fact, it contains the names of all files (and also directories) in that folder. Anyone have an idea why modern versions of MacOS still uses a .DS_Store file? The OS could just as easily read and display the contents of a directory. And deleting a .DS_Store file doesn't seem to have any noticeabl…

I believe if you've dragged some files around in that folder, it stores where those were. Or if you've set the folder to sort by name or date modified, etc.

I've noticed that the .DS_Store file doesn't appear in a directory until I've clicked the triangle in a list view to see the contents of a subfolder. Then it creates one, I assume, to keep track of which subfolders are open.

Re: Parsing the .DS_Store File Format (2018)

#8
post #2

>>Apple's operating system creates this file in apparently all directories to store meta information about its contents. In fact, it contains the names of all files (and also directories) in that folder. Anyone have an idea why modern versions of MacOS still uses a .DS_Store file? The OS could just as easily read and display the contents of a directory. And deleting a .DS_Store file doesn't seem to have any noticeabl…

I believe if you've dragged some files around in that folder, it stores where those were. Or if you've set the folder to sort by name or date modified, etc.

Right. I would assume custom icons and labels (do those still e its?).

Basically it seems to be the replacement for the old resource fork data on non-Apple file systems.

Re: Parsing the .DS_Store File Format (2018)

#9
post #5

Curious what creative use cases people have around this bizarre file format. The only reason myself and millions of other people have to deal with this stupid file is adding it to .gitignore as part of the ritual of spinning up a new codebase

nitpick: As it’s a platform and machine specific thing, technically it shouldn’t be in .gitignore but in .git/info/exclude People working on Linux or Windows do not need to know about garbage your dev env leaves on your machine. I’m saying this half-seriously as I fully understand that these are so common, it’s more convenient to have the exclusion synced between clones. That said, as a purist, none of the repos I’m…

Also there is a preference you can set with the defaults command to stop MacOS from putting them on file systems it encounters.

Re: Parsing the .DS_Store File Format (2018)

#10
post #5

Curious what creative use cases people have around this bizarre file format. The only reason myself and millions of other people have to deal with this stupid file is adding it to .gitignore as part of the ritual of spinning up a new codebase

nitpick: As it’s a platform and machine specific thing, technically it shouldn’t be in .gitignore but in .git/info/exclude People working on Linux or Windows do not need to know about garbage your dev env leaves on your machine. I’m saying this half-seriously as I fully understand that these are so common, it’s more convenient to have the exclusion synced between clones. That said, as a purist, none of the repos I’m…

Interesting, I guess I live in impur lands :)

I understand the pollution concern… but unless that .git/info/exclude is standard in the company, what prevents a intern to not have a correct exclusion there, and happily push a .ds file ?

.gitignore looks more robust to the obvious user. And it’s not like it’s a file you need to look at attentively every day.

But yes, I do see that you are correct!

Post reply on HN