Hello. I'm working on a sample project of a network file system using FSKit. The problem I'm currently facing is FSItem
s not getting reclaimed after they disappear from the file system. If an item deletion goes through the file system, I get the removeItem()
and reclaimItem()
callbacks. When deletion goes though a different client to the network file system I force an enumeration of the parent directory and FSKit gets the directory contents. The problem is the FSItem
instances that are now missing from the contents don't get reclaimed or removed in any way and remain in memory. This gets reproduced both on macOS 15.6.1 + Xcode 16.4 and the latest beta software versions. Is there any way to work around this?
Thanks
Hello. I'm working on a sample project of a network file system using FSKit. The problem I'm currently facing is FSItems not getting reclaimed after they disappear from the file system
Unfortunately, the answer here is basically "yes". The current API is focused on local storage where this kind of "external modification" cannot occur, so the API support you need simply does not exist. Having said that, this is definitely a use case the team is aware of and interested in support. Please file an enhancement request* describing what you're working on and what API support you'd like to see, then post the bug number back here. The team is actively interested in supporting network file systems, so this is a good time to let them know exactly what you're looking "for".
*One thing to understand here is that the goal of a bug like this isn't really to tell the team about a "problem" (they already know what missing), but is to both let them know what you want and help the team justify and prioritize their work.
Is there any way to work around this?
It's not possible within the FSKit extension but I think you can make it work from "outside" the file system- so, in the deletion case, you "delete" a file by having a helper process/daemon "do" the deletion, so that the VFS system see that operation occurring locally. Putting that another way, you're basically using an "extra" user process that represents the server so that all changes appear to be happening through the local file system.
__
Kevin Elliott
DTS Engineer, CoreOS/Hardware