Skip to content

FSKit macOS xcode26.0 b1

Rolf Bjarne Kvinge edited this page Aug 12, 2025 · 3 revisions

#FSKit.framework https://github.com/dotnet/macios/pull/23562

diff -ruN /Applications/Xcode_16.4.0.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/FSKit.framework/Headers/FSKitDefines.h /Applications/Xcode_26.0.0-beta.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/FSKit.framework/Headers/FSKitDefines.h --- /Applications/Xcode_16.4.0.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/FSKit.framework/Headers/FSKitDefines.h	2025-04-22 23:14:16 +++ /Applications/Xcode_26.0.0-beta.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/FSKit.framework/Headers/FSKitDefines.h	2025-05-30 23:39:08 @@ -39,4 +39,8 @@ // Unavailable in original API #define FSKIT_API_UNAVAILABLE_V1 API_UNAVAILABLE(macos, ios, visionos) API_UNAVAILABLE(watchos, tvos) +// macOS 16 API +#define FSKIT_API_AVAILABILITY_V2 API_AVAILABLE(macos(26.0)) \ + API_UNAVAILABLE(ios, visionos) API_UNAVAILABLE(watchos, tvos) + #endif /* FSKitDefines_h */ diff -ruN /Applications/Xcode_16.4.0.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/FSKit.framework/Headers/FSResource.h /Applications/Xcode_26.0.0-beta.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/FSKit.framework/Headers/FSResource.h --- /Applications/Xcode_16.4.0.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/FSKit.framework/Headers/FSResource.h	2025-04-22 23:14:16 +++ /Applications/Xcode_26.0.0-beta.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/FSKit.framework/Headers/FSResource.h	2025-05-30 23:39:08 @@ -370,6 +370,38 @@ @end +/// A resource representing an abstract URL +/// +FSKIT_API_AVAILABILITY_V2 +@interface FSGenericURLResource : FSResource + +@property (readonly, copy) NSURL * url; + +- (instancetype)initWithURL:(NSURL *)url; + +- (instancetype)init NS_UNAVAILABLE; + +@end + +/// A resource representing a path +/// +/// Represents a file path (possibly security scoped URL). +/// +FSKIT_API_AVAILABILITY_V2 +@interface FSPathURLResource : FSResource + +@property (readonly, copy) NSURL * url; + +- (instancetype)initWithURL:(NSURL *)URL + writable:(BOOL)writable; + +- (instancetype)init NS_UNAVAILABLE; + +@property (readonly, getter=isWritable) + BOOL writable; + +@end + /// Maintenance operations for a file system's resources. /// /// This protocol includes operations to check and format a resource for an ``FSUnaryFileSystem``. diff -ruN /Applications/Xcode_16.4.0.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/FSKit.framework/Headers/FSTask.h /Applications/Xcode_26.0.0-beta.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/FSKit.framework/Headers/FSTask.h --- /Applications/Xcode_16.4.0.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/FSKit.framework/Headers/FSTask.h	2025-04-22 23:14:15 +++ /Applications/Xcode_26.0.0-beta.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/FSKit.framework/Headers/FSTask.h	2025-05-30 23:39:08 @@ -25,6 +25,50 @@ /// - Parameter error: `nil` if the task completed successfully; otherwise, an error that caused the task to fail. - (void)didCompleteWithError:(NSError * _Nullable)error FSKIT_API_AVAILABILITY_V1 NS_SWIFT_NAME(didComplete(error:)); +/// The cancellation handler will be called when the given task has been canceled. +/// +/// The cancellation handler will be called wtihin an independent execution context. The cancellationHandler property is cleared after a task is canceled or completed. This is to accelerate the cleanup of retained state. +/// +/// The exact structuring of the completion handler depends on the structuring of the code imlementing the task. +/// As a concrete example, consider a check operation with the following class: +/// +/// ```obj-c +/// @ interface yourFileSystemChecker : NSObject +/// @property (retain) dispatch_group_t work_group; +/// @property (nonatomic,getter=interrupted) BOOL interrupted; +/// - (void)performCheck:(FSTask *)task +/// progress:(NSProgress *)progress; +/// @ end +/// ``` +/// +/// and a startCheckWithTask:(FSTask *)task like: + +/// ```obj-c +/// { +/// NSProgress *progress = [[NSProgress alloc] init]; +/// yourFileSystemChecker *checker= [[yourFileSystemChecker alloc] init]; +/// checker.work_group = dispatch_group_create(); +/// dispatch_group_enter(checker.work_group); +/// [task setCancellationHandler:^NSError * _Nullable{ +/// checker.terminate = TRUE; +/// dispatch_group_wait(checker.work_group); +/// return nil; +/// }]; +/// dispatch_async(someQueue, ^{[self performCheck:task progress:progress];}); +/// return progress; +/// } +/// ``` +/// +/// > Note: this example did not account for errors while delivered code must. finally, the `performCheck` +/// code should perform the check operation. It should periodically update the progress object and check +/// its `interrupted` variable. The check can either complete successfully, complete with an error, or +/// be interrupted. It should then call `[task didCompleteWithError:...]` wtih the appropriate +/// error value or nil. Finally it should `dispatch_group_leave(self.work_group);` +/// +/// - Returns: An error if the cancellation did not complete successfully. Any returned error will be logged, and FSKit will then terminate all activity in the container. +/// +@property (nullable, copy) NSError * _Nullable(^NS_SWIFT_SENDABLE cancellationHandler)(void) FSKIT_API_AVAILABILITY_V2; + @end NS_ASSUME_NONNULL_END diff -ruN /Applications/Xcode_16.4.0.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/FSKit.framework/Headers/FSUnaryFileSystem.h /Applications/Xcode_26.0.0-beta.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/FSKit.framework/Headers/FSUnaryFileSystem.h --- /Applications/Xcode_16.4.0.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/FSKit.framework/Headers/FSUnaryFileSystem.h	2025-04-22 23:14:15 +++ /Applications/Xcode_26.0.0-beta.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/FSKit.framework/Headers/FSUnaryFileSystem.h	2025-05-30 23:39:08 @@ -35,10 +35,10 @@ /// Implement this method to indicate whether the resource is recognizable and usable. /// - Parameters: /// - resource: The ``FSResource`` to probe. -/// - replyHandler: A block or closure that your implementation invokes when it finishes the probe or encounters an error. Pass an instance of ``FSProbeResult`` with probe results as the first parameter if your probe operation succeeds. If probing fails, pass an error as the second parameter. +/// - reply: A block or closure that your implementation invokes when it finishes the probe or encounters an error. Pass an instance of ``FSProbeResult`` with probe results as the first parameter if your probe operation succeeds. If probing fails, pass an error as the second parameter. -(void)probeResource:(FSResource *)resource replyHandler:(void(^)(FSProbeResult * _Nullable result, - NSError * _Nullable error))replyHandler FSKIT_API_AVAILABILITY_V1 NS_SWIFT_NAME(probeResource(resource:replyHandler:)); + NSError * _Nullable error))reply FSKIT_API_AVAILABILITY_V1 NS_SWIFT_NAME(probeResource(resource:replyHandler:)); /// Requests that the file system load a resource and present it as a volume. /// @@ -49,11 +49,11 @@ /// - Parameters: /// - resource: An ``FSResource`` to load. /// - options: An ``FSTaskOptions`` object specifying options to apply when loading the resource. An ``FSUnaryFileSystem`` supports two options: `-f` for "force" and `--rdonly` for read-only. The file system must remember if the read-only option is present. -/// - replyHandler: A block or closure that your implementation invokes when it finishes setting up or encounters an error. Pass a subclass of `FSVolume` as the first parameter if loading succeeds. If loading fails, pass an error as the second parameter. +/// - reply: A block or closure that your implementation invokes when it finishes setting up or encounters an error. Pass a subclass of `FSVolume` as the first parameter if loading succeeds. If loading fails, pass an error as the second parameter. -(void)loadResource:(FSResource *)resource options:(FSTaskOptions *)options replyHandler:(void (^)(FSVolume * _Nullable volume, - NSError * _Nullable err))replyHandler NS_SWIFT_NAME(loadResource(resource:options:replyHandler:)) FSKIT_API_AVAILABILITY_V1; + NSError * _Nullable err))reply NS_SWIFT_NAME(loadResource(resource:options:replyHandler:)) FSKIT_API_AVAILABILITY_V1; /// Requests that the file system unload the specified resource. /// diff -ruN /Applications/Xcode_16.4.0.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/FSKit.framework/Headers/FSVolume.h /Applications/Xcode_26.0.0-beta.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/FSKit.framework/Headers/FSVolume.h --- /Applications/Xcode_16.4.0.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/FSKit.framework/Headers/FSVolume.h	2025-04-22 23:14:15 +++ /Applications/Xcode_26.0.0-beta.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/FSKit.framework/Headers/FSVolume.h	2025-05-30 23:39:08 @@ -383,6 +383,22 @@ /// A property that provides up-to-date statistics of the volume. @property (readonly, nonatomic) FSStatFSResult * volumeStatistics; +@optional + +/// A property that allows the file system to use open-unlink emulation. +/// +/// _Open-unlink_ functionality refers to a file system's ability to support an open file being fully unlinked from the file system namespace. +/// If a file system doesn't support this functionality, FSKit can emulate it instead; this is called "open-unlink emulation". +/// +/// Implement this property to return `true` (Swift) or `YES` (Objective-C) to allow FSKit to perform open-unlink emulation. +/// If you don't implement this property at all, FSKit doesn't perform open-unlink emulation for this volume. +/// +/// FSKit reads this value after the file system replies to the `loadResource` message. +/// Changing the returned value during the runtime of the volume has no effect. +@property BOOL enableOpenUnlinkEmulation FSKIT_API_AVAILABILITY_V2; + +@required + /// Mounts this volume, using the specified options. /// /// FSKit calls this method as a signal that some process is trying to mount this volume. 
Clone this wiki locally