FSKit

macos 15.4 beta claims to support FSKit. Is there an FSKit sample available? I don't see anything useful in the published docs.

Answered by DTS Engineer in 828862022
Written by alexfs123 in 776322021
Is there an FSKit sample available?

Not an official one from Apple.

Written by Etresoft in 828637022
Apple's open source implementation of the MSDOS filesystem

You have to be careful here. While the msdos.appex target is based on FSKit technology, the FSKit API evolved quite a bit during its evolution over the macOS 15 lifecycle. So it’s fine to consult this for ideas, but you may well run into the relevant differences.

The one that springs immediately to mind is that your module’s main entry point must be in Swift [1].

The best way to get your packaging right is to start from the macOS > File System Extension template in the Xcode 16.3 beta.

Written by Etresoft in 828637022
[Darwin] projects typically won't build outside of Apple's internal system.

Very true.

Share and Enjoy

Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"

[1] Due to the fact that FSKit is based on modern appex technology, that is, ExtensionFoundation / ExtensionKit.

Here is a link to Apple's open source implementation of the MSDOS filesystem using FSKit.

Just so you know, these projects typically won't build outside of Apple's internal system.

Written by alexfs123 in 776322021
Is there an FSKit sample available?

Not an official one from Apple.

Written by Etresoft in 828637022
Apple's open source implementation of the MSDOS filesystem

You have to be careful here. While the msdos.appex target is based on FSKit technology, the FSKit API evolved quite a bit during its evolution over the macOS 15 lifecycle. So it’s fine to consult this for ideas, but you may well run into the relevant differences.

The one that springs immediately to mind is that your module’s main entry point must be in Swift [1].

The best way to get your packaging right is to start from the macOS > File System Extension template in the Xcode 16.3 beta.

Written by Etresoft in 828637022
[Darwin] projects typically won't build outside of Apple's internal system.

Very true.

Share and Enjoy

Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"

[1] Due to the fact that FSKit is based on modern appex technology, that is, ExtensionFoundation / ExtensionKit.

There's no macOS > File System Extension template in the Xcode 16.3 beta 2, am I missing something?

Also would you please clarify about mode entry point, is it UnaryFilesystemExtension implementation class or the one that registers the extension and calls to FSModuleIdentity?

Lastly, after managing to put together some code I can see the extension in the Settings/General/ Extensions list but I don't know how to mount the filesystem. Is the extension supposed to create a fake mountable device under /dev/disk or something similar? Any hints would be appreciated.

Written by alexfs123 in 829013022
There's no macOS > File System Extension template in the Xcode 16.3 beta 2, am I missing something?

I haven’t yet downloaded 16.3b2 [1] but it’s certainly there in 16.3b1.

IMPORTANT It’s a target template, not a project template. Open or create a new macOS app project and then choose File > New > Target.

Regarding your other points, lets get you up and running on the template first and then we can come back to them.

Share and Enjoy

Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"

[1] The perils of answering forums questions from my local coffee shop (-:

Thanks for directing me to the correct template.

I've added a new target as instructed. In the "log stream," I can see activity related to a mount command.

I'm trying to execute mount -F -t MyFS [special] [mount point]. I can see it's always getting rejected by fskitd.

Could you clarify what [special] should be in my case?

Written by alexfs123 in 829160022
Could you clarify what [special] should be in my case?

I’d expect it to be the /dev node of the disk you’re trying to mount.

Keep in mind that the current FSKit supports just one file system type, FSUnaryFileSystem. Quoting the doc comments:

[this] which works with one FSResource and presents it as one FSVolume

This is intended to support traditional file systems, that is, ones that present a volume that’s mounted on a disk (or a partition of a disk). Think FAT, HFS, and so on.

Share and Enjoy

Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"

Suppose I'm interested in implementing a network file system. How's that mapped to /dev?

At this stage I'm unable to hit the probe() callback no matter what I try.

Network file system don’t mount on /dev nodes and thus aren’t supported by FSKit. Repeating myself here:

Written by DTS Engineer in 829236022
[FSUnaryFileSystem] is intended to support traditional file systems … Think FAT, HFS, and so on.

Now, normally I’d suggest that you file an enhancement request for features that you need but, in this case, I can assure you that the FSKit team is well aware of the demand for this particular feature |-:

Share and Enjoy

Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"

Is there any actual documentation about the attributes it suppose to go into Info.plist?

From the template it seems there is a bunch of them but without documentation it's really hard to tell what are the OptionSyntax ones do...

Also it looks like out of box on macOS 15.4, this it not working given -[fskitdXPCServer applyResource:targetBundle:instanceID:initiatorAuditToken:authorizingAuditToken:isProbe:usingBlock:]: Attempt to start disabled extension...

I had to manually add my extension bundle identifier to enabledModules.plist to get it to load... which doesn't seem right 😛

FSKit
 
 
Q