Live data from Hacker News

HFS+ is crazy

liminality.xyz

111–120 of 211 posts

Re: HFS+ is crazy

#111
If you'd like to learn more about resource forks on the Mac, which were a very clever solution to a difficult set of problems, please read this, written by the person who created them:

http://www.folklore.org/StoryView.py?story=The_Grand_Unified...

If you want to know more about the invention and early history of the Macintosh in general, there's tons more at http://www.folklore.org (or in the book based on it, Revolution in The Valley, by Andy Hertzfeld).

Re: HFS+ is crazy

#112
post #76

Earlier quoted context omitted.

Which? Apple won't adopt anything GPL, so BTRFS, XFS, JFS, etc--basically every Linux project is right out. It was almost ZFS, years ago, but Apple backed out when Oracle bought Sun. What out there is modern, good, and under a compatible license? HAMMER?

They could probably buy up the rights to BeFS for really cheap now. It was a beautiful file system, in my opinion.

IIRC, they hired Dominic Giampaolo to work on the file system for a while -- he was responsible for adding journaling to HFS+ and started Spotlight, which has a lot in common with BeFS's attributes. He apparently worked on a new file system for them but it never shipped.

http://www.nobius.org/~dbg/

Re: HFS+ is crazy

#113
post #90
post #27

Earlier quoted context omitted.

> That said, I agree, it's a horrible design - but it's existed for 20+ years already. Actually there's absolutely nothing horrible about resource forks/extended attributes in theory. We use way worse ideas like "sidecar" files and metadata stored centrally for the same use cases, which are worse ways to handle the issue. The real problem is the lack of agreement/interoperability in handling them across FSs (and perh…

Who cares if it's a fine idea in theory, when in reality it's completely unpractical. What you call 'worse' is a model that works. Files showing the wrong size are a very small part of the problem. If people actively start storing critical data in resource forks (as it was done in the case of the font), a lot of other things will break. Just think of the humble HTML upload form or Git. Almost everywhere a file is con…

yes I want to reemphasize coldtea's point. These resource forks are part of the core platform and the tools that need to use them have the code to be able to manipulate them.

Anyone who's ever worked with Macs - including software writers, tool writers, developers, know about resource forks - and it's fine because major tools have been rewritten to be resource fork aware.

Nothing's really gone wrong in the sense of reality and while there may be hiccups, you don't really see users actually complain about resource forks.

It's the hypothetical case where "people actively start storing critical data ..." etc. In this case, those people haven't done their homework about the mac platform. Like the Original Post of this HN thread - this person clearly hasn't read the docs re: resource forks and is hacking around, assuming that the mac should be like any of the platforms they've used before, and complaining when it is different.

There are also extensive - majorly detailed documentation from Apple themselves re how resource forks are used and in which circumstances:

https://developer.apple.com/search/?q=%22resource%20fork%22

That gives a ton of hits. Just read the docs. Really.

Again, I pull out the old Windows example moving from FAT to FAT32

8.3 filenames -> Long filenames contains a backwards compatible way to truncate long filenames back down to 8.3. So what if someone stores critical information in the long filename that is suddenly lost when round-tripping through an OS that doesn't understand long file names? SHOCK!! HORROR! Reality is no one does that. End of story.

https://en.wikipedia.org/wiki/Long_filename

Platforms are different! just learn what's different so that you don't get caught unaware.

Re: HFS+ is crazy

#114

Alternate parts to the main file are present on several platforms, and have the same problems. They are called resource forks on Mac. On Windows/NTFS they are called alternate data streams - https://en.wikipedia.org/wiki/Fork_(file_system) - to use specify a colon and name after the filename (eg example.txt:myads). On Unix, Linux, OS/2 etc you can find extended attributes - https://en.wikipedia.org/wiki/Extended_file…

Apple added support for extended attributes to HFS+ in Mac OS X 10.4 Tiger:

http://arstechnica.com/apple/2005/04/macosx-10-4/7/#extended...

Today, resource forks are actually exposed through the extended attributes interface:

http://arstechnica.com/apple/2013/10/os-x-10-9/9/#tags-imple...

You can see the source code for all this in Apple's Darwin open source repository. Example: http://opensource.apple.com/source/xnu/xnu-2782.40.9/bsd/hfs...

Please read this, written by the creator of resource forks, to learn why they exist:

http://www.folklore.org/StoryView.py?story=The_Grand_Unified...

Re: HFS+ is crazy

#115
post #2

TLDR: Mac filesystems have resource forks. I guess the author has not used Macs too much, as they have been around since the 1980's.

TLDR: all standard applications for working with files are unaware of resource forks. This is confusing, and hurts new computer users. #consideredharmful

You act like that's not intentional. If it's a feature that's there for legacy reasons only and it's used as little as possible by the system, and not one iota more, why the heck should Finder, et al expose it to users? In the (very, very, very) rare case that a user actually needs to get into the resource fork of some antiquated file, that user (who is going to be very technical by definition, otherwise how the heck would they even stumble across such a file or care about what's in it?) can simply use the very widely known and documented command line tools or APIs for dealing with it. Anything more than that and you'd just be encouraging people to use a feature that you don't want anyone to use in the first place.

There's a difference between having a feature you want everyone to use, vs. having a feature that only exists for very specific legacy reasons in very specific systems-level backwards-compatibility scenarios, that you don't want anyone to use under any circumstances. Exposing the feature more than it already is exposed would be far more confusing and hurtful to new computer users, most of whom don't understand working with filesystems in general much less specific low-level filesystem features like resource forks.

Re: HFS+ is crazy

#116

It's amazing how garbage like this always rockets to the top of HN. This guy doesn't know anything about file systems or about the operating system he's using. But he sounds confident, so that's evidently good enough for a lot of people. If you think it's crazy that a file system supports multiple data forks/steams, then you don't know very much about file systems. If you think it's crazy that an operating system mai…

yes. how often do you click some top voted link and it starts off sounding like it's going to be some in-depth and provocative analysis and it turns out the author only learned how to copy that style of that writing so the post abruptly ends when he's reached the limit of his ability, which just like this post, is pretty quickly.

Re: HFS+ is crazy

#117

Earlier quoted context omitted.

The problem is that *nix tools only support technology that existed in 1972. Anything newer than that is screwed. Mac Classic's death knell was the increasing popularity of the Internet. Run by servers that couldn't possibly store Mac Classic files correctly, because guess what? Resource forks/alternative data streams/whatever didn't exist back in 1972. And yes I am still bitter about this.

That's an important point. I think however elegant for its time the 70s/early 80s UNIX design, it holds us back in many ways. It's amazing that we still widely use a language without a string type and memory safety like C for example, instead of something like Rust, Swift and co -- with occasional excursions to unsafety maybe for speed/interoperability with older libs, but not as the default for the whole goddamn cod…

> It's amazing how even a simple improvement like systemd gets tons of negativity from admin types and people who think 70s designs should be set in stone.

That is misrepresenting (perhaps to the point of straw man) the systemd complaints.

Re: HFS+ is crazy

#118

Alternate parts to the main file are present on several platforms, and have the same problems. They are called resource forks on Mac. On Windows/NTFS they are called alternate data streams - https://en.wikipedia.org/wiki/Fork_(file_system) - to use specify a colon and name after the filename (eg example.txt:myads). On Unix, Linux, OS/2 etc you can find extended attributes - https://en.wikipedia.org/wiki/Extended_file…

You wouldn't put the entire content of a file in an extended attribute, would you?

In Classic Mac OS, most executables consisted entirely of resource forks. Even the code was stored in resources of type CODE.

Re: HFS+ is crazy

#119
post #78

It's amazing how garbage like this always rockets to the top of HN. This guy doesn't know anything about file systems or about the operating system he's using. But he sounds confident, so that's evidently good enough for a lot of people. If you think it's crazy that a file system supports multiple data forks/steams, then you don't know very much about file systems. If you think it's crazy that an operating system mai…

People don't know what they don't know. Talking down to people who think something is strange for being the way it is, instead of explaining to them why it is, is so counterproductive and serves no purpose. Everyone has things they don't know, just provide an explanation instead of an arrogant comment. He even says "I'm sure there's an Apple-y reason for the existence of this feature, but I can't imagine what it migh…

I don't read the blogpost the same way. I read it as confident condescension.

Re: HFS+ is crazy

#120
post #47

Resource forks were pretty cool, actually: they were a simple database attached to every file, which could be used to store metadata or other information. It was pretty common for applications to store fonts, icons &c. all in their resource forks. Back when I was a kid I used to use ResEdit to change application & file icons, fiddle with GUI controls, change menu structures and so on. Happy days!

I remember back in the day I would hack on mods for a series of games called Escape Velocity. And these mods were entirely created using resource forks for everything from game logic to flavor text to images. ResEdit was the closest thing we had to an IDE. Compared to source control that would allow us to collaborate, or even SQlite databases that could be trivially backed up, it felt like we could lose our work at any time. But at the end of the day, that was part of the fun.

More info on how it worked: https://en.wikipedia.org/wiki/Plug-in_(Escape_Velocity) (why this is a relevant article in Wikipedia, I have no idea.)

Note to anyone reading this, though: If you're designing a system from scratch, don't even think about using resource forks to store data. Just say no.

Post reply on HN