Skip to content

FSKit macOS xcode27.3 b2

Alex Soto edited this page Nov 24, 2026 · 2 revisions

#FSKit.framework

diff -ruN /Applications/Xcode_27.3.0-beta1.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/FSKit.framework/Headers/FSKitDefines.h /Applications/Xcode_27.3.0-beta2.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/FSKit.framework/Headers/FSKitDefines.h
--- /Applications/Xcode_27.3.0-beta1.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/FSKit.framework/Headers/FSKitDefines.h	2026-11-04 03:32:07
+++ /Applications/Xcode_27.3.0-beta2.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/FSKit.framework/Headers/FSKitDefines.h	2026-11-23 18:18:33
@@ -51,6 +51,10 @@
 #define FSKIT_API_AVAILABILITY_V3 API_AVAILABLE(macos(27.0)) \
     API_UNAVAILABLE(ios, visionos) API_UNAVAILABLE(watchos, tvos)
 
+// macOS 27.3 API
+#define FSKIT_API_AVAILABILITY_V3_3 API_AVAILABLE(macos(27.3)) \
+    API_UNAVAILABLE(ios, visionos) API_UNAVAILABLE(watchos, tvos)
+
 // original API that is getting deprecated in macOS 27
 #define FSKIT_API_INTRODUCED_V1_DEPRECATED_V3_WITH_REPLACEMENT(replacement) \
     API_DEPRECATED_WITH_REPLACEMENT(replacement, macos(15.4, 27.0)) \
diff -ruN /Applications/Xcode_27.3.0-beta1.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/FSKit.framework/Headers/FSVolume.h /Applications/Xcode_27.3.0-beta2.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/FSKit.framework/Headers/FSVolume.h
--- /Applications/Xcode_27.3.0-beta1.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/FSKit.framework/Headers/FSVolume.h	2026-11-04 03:32:07
+++ /Applications/Xcode_27.3.0-beta2.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/FSKit.framework/Headers/FSVolume.h	2026-11-23 18:18:33
@@ -585,7 +585,7 @@
 
 /// Renames an item from one path in the file system to another.
 ///
-/// > Note: This method only implements plain `rename(2)` semantics. FSKit fails `renamex_np(2)` calls that pass flags, such as `RENAME_SWAP` or `RENAME_EXCL`, with `ENOTSUP` without calling this method.
+/// > Note: This method only implements plain `rename(2)` semantics. FSKit fails `renamex_np(2)` calls that pass flags, such as `RENAME_SWAP` or `RENAME_EXCL`, with `ENOTSUP` without calling this method. To support those flags, implement both ``FSVolume/Handler/supportedRenameFlags`` and ``FSVolume/Handler/renameItem(_:inDirectory:named:to:inDirectory:overItem:flags:context:replyHandler:)``.
 ///
 /// Implement renaming along the lines of this algorithm:
 ///
@@ -730,6 +730,21 @@
 @end
 
 
+/// Behavior flags for a rename operation, corresponding to the flags accepted by `renamex_np(2)`.
+///
+/// FSKit passes these flags to ``FSVolume/Handler/renameItem(_:inDirectory:named:to:inDirectory:overItem:flags:context:replyHandler:)`` so that a volume can honor them atomically as part of the rename.
+FSKIT_API_AVAILABILITY_V3_3
+typedef NS_OPTIONS(NSUInteger, FSRenameFlags) {
+    /// No rename flags; the operation behaves as a plain `rename(2)`.
+    FSRenameFlagsNone       = 0x00000000,
+    /// Atomically exchange the source and destination items, as with `RENAME_SWAP`.
+    ///
+    /// Both the source and destination must exist. On success, the two items are exchanged.
+    FSRenameFlagsSwap       = 0x00000002,
+    /// Fail with `EEXIST` if the destination already exists, as with `RENAME_EXCL`.
+    FSRenameFlagsExclusive  = 0x00000004,
+} NS_SWIFT_NAME(FSVolume.RenameFlags);
+
 /// Methods that all volumes implement to provide required capabilities.
 ///
 /// Conform to this protocol in your subclass of ``FSVolume``.
@@ -890,7 +905,7 @@
 
 /// Renames an item from one path in the file system to another.
 ///
-/// > Note: This method only implements plain `rename(2)` semantics. FSKit fails `renamex_np(2)` calls that pass flags, such as `RENAME_SWAP` or `RENAME_EXCL`, with `ENOTSUP` without calling this method.
+/// > Note: This method only implements plain `rename(2)` semantics. FSKit fails `renamex_np(2)` calls that pass flags, such as `RENAME_SWAP` or `RENAME_EXCL`, with `ENOTSUP` without calling this method. To support those flags, implement both ``supportedRenameFlags`` and ``renameItem(_:inDirectory:named:to:inDirectory:overItem:flags:context:replyHandler:)``.
 ///
 /// Implement renaming along the lines of this algorithm:
 ///
@@ -936,6 +951,50 @@
            context:(FSContext *)context
       replyHandler:(void(^)(FSRenameItemResult * _Nullable result, NSError * _Nullable error))FSKIT_CALLED_ONCE reply
 NS_SWIFT_NAME(renameItem(_:inDirectory:named:to:inDirectory:overItem:context:replyHandler:));
+
+@optional
+/// The subset of `renamex_np(2)` flags this volume can honor.
+///
+/// Implement this property alongside ``renameItem(_:inDirectory:named:to:inDirectory:overItem:flags:context:replyHandler:)`` to declare which flags your file system supports. FSKit advertises the matching interface capabilities — `VOL_CAP_INT_RENAME_SWAP` for ``FSRenameFlags/swap`` and `VOL_CAP_INT_RENAME_EXCL` for ``FSRenameFlags/exclusive`` — so applications can discover them with `getattrlist(2)`.
+///
+/// > Note: FSKit will fail any rename requesting a flag that isn't included here with an error code of `ENOTSUP`. If you don't implement this property, FSKit assumes the volume supports no rename flags, and fails every flagged `renamex_np(2)` with `ENOTSUP`.
+///
+/// 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 (readonly) FSRenameFlags supportedRenameFlags
+FSKIT_API_AVAILABILITY_V3_3;
+
+/// Renames an item, honoring the flags of `renamex_np(2)`.
+///
+/// This method behaves like ``renameItem(_:inDirectory:named:to:inDirectory:overItem:context:replyHandler:)``, but additionally receives the ``FSRenameFlags`` requested by the caller. Implement this method when your file system can honor `renamex_np(2)` flags such as ``FSRenameFlags/swap`` and ``FSRenameFlags/exclusive``.
+///
+/// Declare the flags your file system can honor with ``supportedRenameFlags``. FSKit advertises the matching `VOL_CAP_INT_RENAME_SWAP` and `VOL_CAP_INT_RENAME_EXCL` interface capabilities, and fails any rename requesting an undeclared flag with `ENOTSUP` before calling this method. If you don't implement ``supportedRenameFlags``, FSKit assumes no flags are supported and this method only ever receives ``FSRenameFlags/none``.
+///
+/// > Note: When a volume implements this method, FSKit dispatches **every** rename to it, including plain renames, for which `flags` is ``FSRenameFlags/none``, instead of ``renameItem(_:inDirectory:named:to:inDirectory:overItem:context:replyHandler:)``.
+///
+/// - Parameters:
+///   - item: The file system object being renamed.
+///   - sourceDirectory: The directory that currently contains the item to rename.
+///   - sourceName: The name of the item within the source directory.
+///   - destinationName: The new name of the item as it appears in `destinationDirectory`.
+///   - destinationDirectory: The directory to contain the renamed object, which may be the same as `sourceDirectory`.
+///   - overItem: The file system object if the destination exists, as discovered in a prior lookup.
+///   - flags: The ``FSRenameFlags`` requested by the caller. FSKit only passes flags included in ``supportedRenameFlags``. Honor them atomically as part of the rename.
+///   - context: An object that enables context-aware file system decisions throughout the operation.
+///   - reply: A block or closure to indicate success or failure. On success, pass an instance of ``FSRenameItemResult`` and a `nil` error; on failure, pass the relevant error. For an `async` Swift implementation, there's no reply handler; simply return the result instance or throw an error.
+- (void)renameItem:(FSItem *)item
+       inDirectory:(FSItem *)sourceDirectory
+             named:(FSFileName *)sourceName
+         toNewName:(FSFileName *)destinationName
+       inDirectory:(FSItem *)destinationDirectory
+          overItem:(FSItem * _Nullable)overItem
+             flags:(FSRenameFlags)flags
+           context:(FSContext *)context
+      replyHandler:(void(^)(FSRenameItemResult * _Nullable result, NSError * _Nullable error))FSKIT_CALLED_ONCE reply
+FSKIT_API_AVAILABILITY_V3_3
+NS_SWIFT_NAME(renameItem(_:inDirectory:named:to:inDirectory:overItem:flags:context:replyHandler:));
+
+@required
 
 /// Removes an existing item from a given directory.
 ///
diff -ruN /Applications/Xcode_27.3.0-beta1.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/FSKit.framework/Headers/FSVolumeHandlerResult.h /Applications/Xcode_27.3.0-beta2.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/FSKit.framework/Headers/FSVolumeHandlerResult.h
--- /Applications/Xcode_27.3.0-beta1.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/FSKit.framework/Headers/FSVolumeHandlerResult.h	2026-11-04 03:32:07
+++ /Applications/Xcode_27.3.0-beta2.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/FSKit.framework/Headers/FSVolumeHandlerResult.h	2026-11-23 18:18:33
@@ -145,7 +145,7 @@
 
 /// The result of a rename-item call.
 ///
-/// Use this type in your implementation of  ``FSVolume/Handler/renameItem(_:inDirectory:named:to:inDirectory:overItem:context:replyHandler:)``.
+/// Use this type in your implementation of  ``FSVolume/Handler/renameItem(_:inDirectory:named:to:inDirectory:overItem:context:replyHandler:)`` and ``FSVolume/Handler/renameItem(_:inDirectory:named:to:inDirectory:overItem:flags:context:replyHandler:)``.
 FSKIT_API_AVAILABILITY_V3
 @interface FSRenameItemResult : FSVolumeHandlerResult
 

Clone this wiki locally