Normal view

There are new articles available, click to refresh the page.
Before yesterdayMain stream

Customising folders in Tahoe

By: hoakley
18 September 2025 at 14:30

macOS 26 Tahoe has many smaller enhancements to make life easier. Among them is a novel way of customising folder icons, as explained here.

Traditional custom folder icons

One of the most ancient features in macOS is adding a different icon to a file or folder, by pasting it into the top left of the Get Info dialog for that item. I have detailed how to do that, and how it works, in this article. While that still works, it has some significant limitations and is fiddly.

Another disappointing behaviour in previous macOS is the effect of adding coloured Finder tags to folders, which don’t change the colour of the folder as displayed.

Tahoe custom folders

macOS 26 changes the behaviour of folder icons in three ways:

  • Default folder colour is now set in Appearance settings. In most cases, that will be left to use the Theme colour.
  • Applying a coloured Finder tag to a folder now changes the colour of that folder, as well as displaying a coloured dot.
  • Folders can be customised additionally using the Customise Folder… command in the Finder’s File or contextual menu.

The last of those merits further attention, and an explanation of how it works.

Customising folders

Rather than adding an arbitrary icon to a folder, Tahoe’s custom folders consist of a traditional folder icon with a symbol or emoji superimposed. These are selected from a wide range of vector graphic symbols drawn from Apple’s huge SF Symbols collection, or the standard range of Unicode emoji.

Symbols appear embossed with little difference in tone, so aren’t easy to distinguish unless the folder icon is quite large. This isn’t suitable for use in the Finder’s Column or List views.

The familiar range of emoji is usually clearer and readily distinguishable in most sizes.

Adding a coloured Finder tag to a customised folder makes it even more distinctive, and increases colour contrast with the emoji.

Not only does this look good, but it solves the problems associated with old-style custom folder icons. Copy that folder anywhere within your Mac, and its new look goes with it. Move it into iCloud Drive, and it goes there too. Although Macs and devices running older versions don’t show the custom folder in its full glory, those running OS 26 do. Yes, open Files on your iPhone and you’ll see the custom icon there too.

The only shortcoming that I can find is that, while you can search for specific Finder tags in Spotlight, you can’t search for the symbol or emoji displayed on the folder icon. There is a search attribute Custom Icon, but these folders aren’t considered to have that attribute.

How it works

Tahoe’s custom folders rely on a combination of two extended attributes (xattrs) attached to the folder:

  • com.apple.FinderInfo, 32 bytes that is also used in other Finder settings;
  • com.apple.icon.folder, new to Tahoe and containing details of the symbol or emoji to be displayed.

Both have to be attached to the folder for it to be displayed correctly.

com.apple.icon.folder is of particular interest, as it has an S flag, and is itself usually displayed as com.apple.icon.folder#S. The S tells macOS that xattr should be preserved during syncing with services such as iCloud Drive. A full list of xattr flags is given in the Appendix. This xattr contains a Unicode string such as
{"emoji":"🔍"}
for an emoji, or
{"sym":"person.crop.circle")
for one of the vector graphics in SF Symbols. The first is self-explanatory, while the second uses the name of that symbol in the SF Symbols library. This currently only supports a subset of the whole library, and my attempts to get it to use others from SF Symbols have so far failed.

Conclusion

macOS has succeeded because of its attention to detail. Tahoe’s new custom folders are an excellent example. Enjoy them!

Postscript

For those who want to disable Tahoe’s default of colouring tagged folders according to one of the tag colours, I’ve now discovered that you can disable that in the control Tint folder based on tags at the foot of the Tags view in Finder’s Settings.

Appendix: Xattr flags

Flags can be upper or lower case letters C, N, P, S or B, and invariably follow the # separator, which is presumably otherwise forbidden from use in a xattr’s name. Upper case sets or enables that property, while lower case clears or disables that property. There are currently five properties:

  • C: XATTR_FLAG_CONTENT_DEPENDENT, which ties the flag and the file contents, so the xattr is rewritten when the file data changes. This is normally used for checksums and hashes, text encoding, and position information. The xattr is preserved for copy and share, but not in a safe save.
  • P: XATTR_FLAG_NO_EXPORT, which doesn’t export or share the xattr, but normally preserves it during copying.
  • N: XATTR_FLAG_NEVER_PRESERVE, which ensures the xattr is never copied, even when copying the file.
  • S: XATTR_FLAG_SYNCABLE, which ensures the xattr is preserved during syncing with services such as iCloud Drive. Default behaviour is for xattrs to be stripped during syncing, to minimise the amount of data to be transferred, but this will override that.
  • B: XATTR_FLAG_ONLY_BACKUP, which keeps the xattr only in backups, including Time Machine (added recently).

These operate within another general restriction of xattrs: their name cannot exceed a maximum of 127 UTF-8 characters.

How large is that file?

By: hoakley
1 September 2025 at 14:30

At first sight, this might seem a simple question to answer. Allow me to demonstrate that it’s more complex, has changed over time, and still hasn’t been resolved.

Before 1984

Although there were exceptions, before the Mac most file systems that we were likely to encounter were simple. Each file consisted of stored data, together with a small entry in the file system’s metadata containing information such as the file’s name and its time and date of creation. By convention, as that’s not stored with the file’s data, that isn’t included in its size.

The only complication here was that storage is divided up into blocks, so in addition to the file’s actual size, we’d also want to know the total size taken by the storage blocks it used, as any given block couldn’t be shared between files, a figure often known as size on disk, and dependent on the size of those blocks. If the block size is 4,096 bytes, then any file whose data was equal to or smaller than that had a size on disk of 4,096 bytes, 4 KiB or 4.096 KB. (There are 1,000 bytes in a KB, but 1,024 bytes in a KiB.)

Classic Mac OS

One of the many innovations in the first Mac was its file system MFS, in which every file has two forks, one the traditional data fork, the other a resource fork for storing structured blobs of data termed resources. As MFS was replaced by HFS and eventually HFS+, those resource forks continued.

filesize04

Resource forks often reached considerable sizes, and although they are stored separately from data forks in HFS+, Apple usually gave the sizes of the two forks, as shown in this dialog, where the size of the resource fork is 117,836 bytes, almost as large as the file’s 144,788 bytes of data. Information about the size of that file’s entry in the file system data, its attributes, wasn’t given, though.

HFS+ in Mac OS X

In the early years of Mac OS X, there was controversy as to whether it should continue supporting the use of resource forks, and most of their uses were replaced by flattened data files arranged in bundles. Nevertheless, in Mac OS X 10.4, HFS+ became multi-forked with what were dubbed extended attributes or xattrs, one type being com.apple.ResourceFork, the classic resource fork. However, the practice of giving separate sizes for the data fork and other forks died.

APFS

When APFS was released in 2017, it changed the way in which xattrs are stored, as explained here. Now, each file can consist of:

  1. file system attributes, stored in the file system metadata structures;
  2. small xattrs of up to 3,804 bytes, stored separately from its attributes, but in file system metadata;
  3. large xattrs over 3,804 bytes, typically including any com.apple.ResourceFork, stored as data streams with separate records;
  4. data, stored in storage blocks as set out in their file extents.

As demonstrated using crafted files, initially the Finder ignored items 1-3 in stating file size, and just gave that of 4, the data, although it could instead still have been including resource forks, of course.

filesize02

The size of this text file is given as 391 bytes in the Finder’s Get Info in High Sierra, but as you’ll see below it contains over 90,000 bytes of extended attributes that figure simply ignores.

filesize01

macOS Sequoia

Here are the sizes given for another of my specially crafted demonstration files, for APFS in macOS 15.6.1 Sequoia.

According to the Finder’s Get Info dialog, this file contains 263,195 bytes and occupies 266 KB on disk. On an SSD with the standard 4 KiB block size, that should be 65 blocks, or 266,240 bytes, as given correctly. There’s something amiss with that file, though, as it claims to be a Zip archive but has an image thumbnail.

Listing its xattrs using xattred reveals no less than 14, including two of 80 KB each. xattred claims it has a data fork size of 183,136 bytes and 161,406 bytes in xattrs, making a total size of 344,542 bytes, which is nowhere near that given by the Finder. (It’s the com.apple.ResourceFork xattr, a classic resource fork, that contains the image thumbnail displayed by QuickLook instead of the normal Zip file icon.)

To discover how the Finder arrives at a size of 263,195 bytes, we need to subtract the data size from that, making 80,059 bytes, the size of the file’s resource fork or com.apple.ResourceFork xattr. So, without being explicit about forks, it’s behaving the same as in Classic Mac OS. You might find that puzzling, given that there’s another xattr of the same size that it’s ignoring, and a dozen more that don’t get a look-in. As the use of com.apple.ResourceFork xattrs has long been discouraged if not deprecated, isn’t that a strange behaviour? The more so when modern xattrs that Apple has introduced relatively recently, such as com.apple.quarantine, com.apple.macl and com.apple.provenance, are ignored.

The deeper you look into this, the more puzzling it becomes. Here are the same file’s figures as shown in Precize.

Sizes are given a few lines down, from two sources, URL Keys and the file system (FileManager), and they also differ. There’s a list of xattrs given at the foot of this window, but that only gives 12 and ignores com.apple.ResourceFork and com.apple.FinderInfo.

In the macOS API, code can obtain values for file sizes from its URL. Two keys are available, fileSizeKey and totalFileSizeKey. The first gives the data size, and the second is the same ‘total’ as that shown by the Finder, i.e. data + com.apple.ResourceFork xattr, but excluding all other xattrs. Apple’s documentation explains those as:

  • fileSize is “the total file size, in bytes”
  • totalFileSize is “the total displayable size of the file, in bytes. The allocated size in bytes may include space used by metadata.”

FileManager also gives the data size in its FileAttributeKey.size, but doesn’t give any for xattrs, even com.apple.ResourceFork. The size of the Metadata shown for the File system is instead calculated by totalling the individual sizes of all its xattrs, including com.apple.ResourceFork and com.apple.FinderInfo.

This may appear to be nit-picking, but data sizes are given to the exact number of bytes, and the size on disk for non-sparse files should always be within 4,095 bytes of the data size. Yet accounting for xattrs remains rooted in Classic Mac OS from 25 years ago and still pretends that xattrs either don’t exist, or don’t take any space.

❌
❌