Live data from Hacker News

HFS+ is crazy

liminality.xyz

151–160 of 211 posts

Re: HFS+ is crazy

#151
post #76
post #30

Earlier quoted context omitted.

I hope you're not right. There are so many wonderful filesystems already out there, many of them already Open Source. I'm not against research, but I'd rather have Apple fund one of these existing efforts.

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?

HAMMER2

Re: HFS+ is crazy

#152
post #24

> Applications — even basic filesystem tools — aren't aware of the additional content. How do you deal with a file with two sets of data? I'm sure there's an Apple-y reason for the existence of this feature, but I can't imagine what it might be. G.K. Chesterton on the matter: In the matter of reforming things, as distinct from deforming them, there is one plain and simple principle; a principle which will probably be…

That'd make a great pull request.

"I was reading this code, and then I found this line that I didn't understand why it was written, so it should be removed."

Re: HFS+ is crazy

#153

Earlier quoted context omitted.

It seems you are knowledgeable on the topic, why not make your criticism a bit more constructive? Why are "multiple data forks/stream" needed and what are they used for? (I don't know very much about file systems)

Basically, the "resource fork" in MacOS was... well, Wikipedia actually puts it pretty well: "a section of a file used to store structured data along with the unstructured data stored within the data fork." It was frequently used to store things like images and icons (and fonts), but could also be used to store metadata. Think of it as the equivalent of having a document database -- a key/value store -- alongside a f…

Howerver, in NTFS at least, attributes/metadata is a pretty flexible database-like storage, yet are not the same thing as alternate streams (a.k.a. resource forks) which are also supported.

Re: HFS+ is crazy

#154

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…

Conflating extattrs with HFS style resource forks doesn't really make sense. Extended attributes are just that... attributes. They are not the main "data" of the file. Each and every unix file system has some attributes to begin with (permissions, timestamps etc.) and they vary from filesystem to filesystem (e.g., setuid bit, immutable bit etc.). User supplied attributes just extends this concept in a natural way. Al…

It's not broken, it's just old. It's a legacy technology from the original Macintosh system released in 1984 - before it was even called "Mac OS". Your "reasonable user expectations" are conditioned by three decades of experience with systems that largely didn't exist when the Macintosh resource fork was designed.

Re: HFS+ is crazy

#155

Earlier quoted context omitted.

> 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.

> That is misrepresenting (perhaps to the point of straw man) the systemd complaints. Maybe, but not the one's I've seen. Can you point to some collection of systemd complaints that go beyond "this is not how things used to be done"?

http://without-systemd.org/wiki/index.php/Arguments_against_...

Re: HFS+ is crazy

#156

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…

It seems you are knowledgeable on the topic, why not make your criticism a bit more constructive? Why are "multiple data forks/stream" needed and what are they used for? (I don't know very much about file systems)

"Originally conceived and implemented by programmer Bruce Horn, the resource fork was used for three purposes with Macintosh file system. First, it was used to store all graphical data on disk until it was needed, then retrieved, drawn on the screen, and thrown away. This software variant of virtual memory helped Apple to reduce the memory requirements of the Apple Lisa from 1 MB to 128 KB in the Macintosh. Second, because all the pictures and text were stored separately in a resource fork, it could be used to allow a non-programmer to translate an application for a foreign market, a process called internationalization and localization. And finally, it could be used to distribute nearly all of the components of an application in a single file, reducing clutter and simplifying application installation and removal."

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

Re: HFS+ is crazy

#157

Earlier quoted context omitted.

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

Actually, I believe OS X does this for small files in order to not burn a whole filesystem block on a sub 1k file. "In Mac OS X Snow Leopard 10.6, HFS+ compression was added. In open source and some other areas this is referred to as AppleFSCompression. Compressed data may be stored in either an extended attribute or the resource fork.[13] When using non-Apple APIs, AppleFSCompression is not always completely transpa…

FS compression is transparent to any regular file-reading API; it only shows up in lower-level APIs, like if you want to copy the file and keep the compression.

Re: HFS+ is crazy

#158

Earlier quoted context omitted.

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

On Mac Classic, if you wanted to ship a custom font with your application, you'd put it in the Resource fork in a resource of "FONT" type. So why wouldn't a stand-alone font file consist of a Resource fork with a single resource of "FONT" type? Otherwise, the OS engineers have to develop two entirely different ways of reading in font data. Why duplicate the effort? The system made perfect sense, both then and now. It…

>On Mac Classic, if you wanted to ship a custom font with your application, you'd put it in the Resource fork in a resource of "FONT" type.

On Windows you can do the same thing with .rsrc in an .exe/.dll file.

It's possible you would ship a font as a PE .dll with a font resource, but for a single file the encapsulation is a little unnecessary (unless your application architecture already makes it easy to deal with PE encapsulation).

Re: HFS+ is crazy

#159

Earlier quoted context omitted.

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…

John, Have you heard any rumblings from within Apple about a new filesystem? Is there any hope?

There's always hope.

Re: HFS+ is crazy

#160

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…

Do you think that a flag for irrelevant content would help? Or just plain flagging?

Just plain flagging is just fine for cases like this. This article has indeed been heavily flagged, which has made it rank lower on the front page. It has also gotten a lot of upvotes, which is why it's still on the front page.
Post reply on HN