Environment
macOS Version: 26.1
Xcode Version: 16.2
Description
I'm developing a custom file system using FSKit and have encountered an issue where the removeItem(_:named:fromDirectory:) method in my FSVolume.Operations implementation is not being invoked when attempting to delete files or directories through Finder or the command line.
Implementation
My volume implements the required FSVolume.Operations protocol with the following removeItem implementation:
func removeItem(
_ item: FSItem,
named name: FSFileName,
fromDirectory directory: FSItem
) async throws {
logger.info("remove: \(name)")
if let item = item as? MyFSItem, let directory = directory as? MyFSItem {
directory.removeItem(item)
} else {
throw fs_errorForPOSIXError(POSIXError.EIO.rawValue)
}
}
Steps to Reproduce
Mount the custom FSKit-based file system using:
mount -F -t MyFS /dev/diskX /tmp/mountpoint
Create files using Finder or terminal (works correctly - createItem is called)
Attempt to delete a file using any of the following methods:
Terminal command: rm -rf /path/to/mounted/file
option + cmd + delete to remove the file in Finder
Expected Behavior
The removeItem(_:named:fromDirectory:) method should be called, logging "remove: [filename]" and removing the item from the directory's children collection.
Actual Behavior
The removeItem method is never invoked. No logs appear from this method in Console.app. The deletion operation either fails silently or returns an error, but the callback never occurs.
Additional Context
Working operations: Other operations work correctly including:
createItem - files and directories can be created
lookupItem - items can be looked up successfully
enumerateDirectory - directory listing works
read and write - file I/O operations work correctly
Volume state:
The volume is properly mounted and accessible
Files can be created, read, and written successfully
Volume capabilities configured:
var supportedVolumeCapabilities: FSVolume.SupportedCapabilities {
let capabilities = FSVolume.SupportedCapabilities()
capabilities.supportsHardLinks = true
capabilities.supportsSymbolicLinks = true
capabilities.supportsPersistentObjectIDs = true
capabilities.doesNotSupportVolumeSizes = true
capabilities.supportsHiddenFiles = true
capabilities.supports64BitObjectIDs = true
capabilities.caseFormat = .insensitiveCasePreserving
return capabilities
}
Questions
Are there specific volume capabilities or entitlements required for removeItem to be invoked?
Is there a specific way deletion operations need to be enabled in FSKit?
Could this be related to how file permissions or attributes are set during createItem?
Are there any known issues with deletion operations in the current FSKit implementation?
Do I need to implement additional protocols or set specific flags to support item deletion?
Any guidance would be greatly appreciated. Has anyone successfully implemented deletion operations in FSKit?
Thank you!
Selecting any option will automatically load the page
Post
Replies
Boosts
Views
Activity
I'm developing a custom file system using FSKit. After testing some example projects on github and have encountered an issue where the removeItem(_:named:fromDirectory:) method in my FSVolume.Operations implementation is not being invoked when attempting to delete files or directories through Finder or the command line.
Environment:
macOS: macOS 26.1
Xcode: 16.2 / 17A400
Sample Project:
https://github.com/KhaosT/FSKitSample
https://github.com/debox-network/FSKitBridge
My volume implements the required FSVolume.Operations protocol with the following removeItem implementation:
func removeItem(
_ item: FSItem,
named name: FSFileName,
fromDirectory directory: FSItem
) async throws {
logger.info("remove: \(name)")
if let item = item as? MyFSItem, let directory = directory as? MyFSItem {
directory.removeItem(item)
} else {
throw fs_errorForPOSIXError(POSIXError.EIO.rawValue)
}
}
Steps to Reproduce:
Mount the custom FSKit-based file system
Create files using Finder or terminal (works correctly - createItem is called)
Attempt to delete a file using:
Terminal command: rm -rf /path/to/mounted/file
option+cmd+delete force to delete file
Expected Behavior:
The removeItem(_:named:fromDirectory:) method should be called, logging "remove: [filename]" and removing the item from the directory's children collection.
Actual Behavior:
The removeItem method is never invoked. No logs appear from this method. The deletion operation either fails silently or returns an error, but the callback never occurs.
Are there specific volume capabilities or entitlements required for removeItem to be invoked or are there any known issues with deletion operations in the current FSKit implementation?
Any guidance would be greatly appreciated.