Live data from Hacker News

The Origins of DS_store (2006)

arno.org

261–270 of 280 posts

Re: The Origins of DS_store (2006)

#261

Earlier quoted context omitted.

Sure, that wouldn't work if the network volume was accessed by different URIs. But it would work in 95% of cases, which is good enough.

Like two websites that look the same, except one captures your creds? You don't want user prefs to apply to multiple locations solely based on URI.

Just because two URIs might appear to be similar doesn't mean they are identical. Using the URI string as a hash key wouldn't be vulnerable to this.

Re: The Origins of DS_store (2006)

#262

Earlier quoted context omitted.

Seems like you have control issues.

Nah, those people have issues controlling their machines. It's fine if you upload useless spam a few times, but at some point you need to quit it because you're creating unnecessary work for others.

Well I was trying to tell you nicely, but you’ll figure it out before long.

Banning someone because they commit a file you don’t like is definitely a sign of a controlling person.

Re: The Origins of DS_store (2006)

#263
post #222

Earlier quoted context omitted.

> One metadata and one the file contents. I’d say this is not the right way to describe a resource fork. Instead, think of it as two sets of file contents—one called "data" and one called "rsrc". On-disk, they are both just bytestreams. The catch is that you usually store a specific structure in the resource fork—smaller chunks of data indexed by 4-byte type codes and 2-byte integer IDs. Applications on the 68K norma…

From https://en.wikipedia.org/wiki/Resource_fork : > While the data fork allows random access to any offset within it, access to the resource fork works like extracting structured records from a database. So, whatever the on-disk structure, the motivation here is that from an OS API perspective , software (including the OS itself) can interact with files as one "seekable stream of bytes" (the data fork), and one "ran…

> So, whatever the on-disk structure, the motivation here is that from an OS API perspective,

There are multiple layers to the OS API. There is the Resource Manager, which provides the structured view. Underneath it is the File Manager, which gives you a stream of bytes. You can use either API to access the resource fork, and there are reasons why you would use the lower-level API.

One example from the documentation was to provide a backup. For various reasons, it was possible that a resource fork could become corrupt—this is back in the day that macOS had no protected memory (for shame!), disk was slow, and we didn’t use journaling filesystems. Some programs kept around backup copies of whatever file you were working on. If your data was stored in the resource fork, well, there’s an easy way to get a backup… just open the resource fork as a stream of bytes and copy it to another place on disk. You could copy it a data fork, and some people even copied it to a data fork in the same file.

The other main reason you would use the lower-level API is because you are writing a program like MacBinary or Stuffit.

> This in mind, it's curious that we never saw an archive file format that sends the hunks within the resource fork as individual files in the archive beside the data-fork file,

Well, there are advantages and disadvantages to that approach. You can already access resources inside a resource fork inside various archive formats, like MacBinary, AppleDouble, and AppleSingle. But you probably do want to preserve the actual byte stream of the resource fork itself. (And there’s also an undocumented compression format for single resources.)

Re: The Origins of DS_store (2006)

#264
post #222

Earlier quoted context omitted.

From https://en.wikipedia.org/wiki/Resource_fork : > While the data fork allows random access to any offset within it, access to the resource fork works like extracting structured records from a database. So, whatever the on-disk structure, the motivation here is that from an OS API perspective , software (including the OS itself) can interact with files as one "seekable stream of bytes" (the data fork), and one "ran…

I am not old enough to know how resource forks were implemented on Mac OS but this is definitely not the case today. Resource forks are implemented (or maybe "emulated" is a better word to use? Not sure how much effort is put into them) as random-access. You can use POSIX APIs to interact with them (using _PATH_RSRCFORKSPEC) and these are typically faster than other interfaces.

Back in the day, you used the Resource Manager to open a resource fork. The resource manager provides functions to load individual resources, query which resources exist, and add or modify existing resources.

The Resource Manager made it to Mac OS X as part of Carbon. The main part of Carbon is gone, but a part of it called CarbonCore survives, and that contains the resource manager. If you dig through the docs, you can find it. It was deprecated in 10.8 (which seems really late… the writing was on the wall about resources back when 10.0 hit).

https://developer.apple.com/documentation/coreservices/carbo...

The modern resource manager functions in CarbonCore I think just use the POSIX API underneath. Undoubtedly, there’s some test suite at Apple that makes sure it works correctly. Also undoubtedly, there’s some application vendors who wrote code using resources in the 1990s and still has some of that shipping today.

Re: The Origins of DS_store (2006)

#265

Earlier quoted context omitted.

> with any user-perceptible lag whatsoever About that part... Modern computers are insanely fast. How does every single piece of software manages to fill half a minute of CPU or disk I/O for enumerating some 3 or 4 items? It's absurd. I use Firefox inside eatmydata nowadays, because it spends 10 minutes enumerating the same 2 directories every time it starts up (hundreds of thousands of times). The start menu and equ…

> I use Firefox inside eatmydata nowadays, because it spends 10 minutes enumerating the same 2 directories every time it starts up (hundreds of thousands of times). What have you got like a 10 year old profile or something? Librewolf starts up instantly for me, and I saw no performance difference using eatmdata.

Why would an old profile cause it to be scanned hundreds of thousands of times? (Yeah, I'm resetting it next time just in case... 10 years is amateur's numbers :) )

Anyway, there are a lot of people reporting the same thing on the internet. I've found 3 different bugs opened for the same thing.

But yeah, as far as I remember, Iceweasel doesn't do it either. Maybe I should change my browser.

Re: The Origins of DS_store (2006)

#266

Earlier quoted context omitted.

Nah, those people have issues controlling their machines. It's fine if you upload useless spam a few times, but at some point you need to quit it because you're creating unnecessary work for others.

Well I was trying to tell you nicely, but you’ll figure it out before long. Banning someone because they commit a file you don’t like is definitely a sign of a controlling person.

Repeatedly. Besides, if you repeatedly pay such little care how can anything you do be trusted?

Re: The Origins of DS_store (2006)

#267

Earlier quoted context omitted.

This also happens with .DS_store files if the other computer on the network isn’t a Mac. It’s irrelevant.

computers other than a mac don’t need DS_Store anyways, so still relevant.

No, the objection to not keeping .DS_Store per folder and doing it per file system instead was that a non-Mac might make changes that would not be seen. The point is that this can already happen for a lot of different reasons! So keeping it per folder doesn't eliminate the failure mode, it just makes it slightly less common… at the cost of annoying all non-Mac users and any Mac user who needs to interact with Git etc. The tradeoff analysis for doing it per folder is bad.

Re: The Origins of DS_store (2006)

#268

Not to mention that it's an obnoxious and incompetent design. Look at the fact that Mac OS litters every other computer it visits with turds, for its own (and in fact only one user's) benefit. It's doubly stupid because the next browsing Mac that comes along trounces the previous one's turd. If Apple wanted to store view settings for remote volumes (or even local volumes), the competent design would have been to stor…

I will raise you- desktop.ini and thumbnails.db

back in windows xp days yes, it's pretty much never a problem nowadays. for the past...almost two decades, actually - thumbnails get stored in user profile folder since vista. (though it is different for network folders and may still be a problem.) and desktop.ini files - you'd only ever encounter them in predefined system folders (like pictures, etc.) or if you manually customize a folder in its properties - customize tab (like changing folder "type" to one like those predefined folders or changing its icon, not the same as changing size/thumbnail size/columns/etc though, that's stored elsewhere too)

Re: The Origins of DS_store (2006)

#269
post #248

Funny all the people complaining about “this makes Mac ugly compared to Linux” meanwhile every Linux tool I install craps dotfiles not only in ~/ but in working folders as well. It’s a fact of life that tens of thousands of smart programmers realized is necessary.

Every Linux tool? Simply not true. Most tools keep it in a ~ subdir like ~/.config MacOS creates a junk file/folder just by visiting any folder. It's not comparable.

You're right, I didn't mean 100% of all linux tools, like coreutils. But every piece of linux software I've purchased a license for does exactly this.

I think people that get upset about this just need something to fret about, at least in my experience. They probably trim their speaker cables to the same length to match impedence, too.

Re: The Origins of DS_store (2006)

#270

I remember there used to ways to turn off the creation of .DS_Store but they removed it, I can't figure out for life why they would make such a change. I had to write a program [0] to watch the entire file system and delete .DS_Store as soon as they're created. [0] https://github.com/slmjkdbtl/dskill

I apple really made a mess when they started adding . in the root of a filesystem and never cleaned it up.

I can see after .DS_Store was allowed, it was no problem for other engineers to approve .fseventsd or .Spotlight-V100 or other nonsense that has cropped up over the years.

And I can't tell you how many filesystems I've had "corrupted" with these sorts of files.

Mostly SD cards, usb flash drives, but occasionally something horrible.

for these kinds of things I usually run:

  rm -rf .DS_Store .Trashes ._.Trashes .fseventsd .Spotlight-V100
and quickly eject the drive before something else is written.

If you've had a disk that is going bad and you need to copy stuff off of it, the LAST thing you want is to index the whole thing and start writing to it.

seriously, there should be a setting.

Post reply on HN