Skip to content

feat: Add one-shot attribute methods to FileSystemProtocol (Fixes #3648) - #3669

Open
wasim-builds wants to merge 5 commits into
apple:mainfrom
wasim-builds:feat/issue-3648-oneshot-attributes
Open

feat: Add one-shot attribute methods to FileSystemProtocol (Fixes #3648)#3669
wasim-builds wants to merge 5 commits into
apple:mainfrom
wasim-builds:feat/issue-3648-oneshot-attributes

Conversation

@wasim-builds

Copy link
Copy Markdown
Contributor

Hey @weissi! 👋

As discussed in #3648, I've added one-shot APIs to FileSystemProtocol to make it easier to set file attributes without having to explicitly open and manage a file handle.

Implementation Details:

  • Added setTimes, setLastAccessTime, and setLastDataModificationTime as default extension methods on FileSystemProtocol.
  • Under the hood, these methods automatically wrap withFileHandle(forReadingAt:) so it avoids the O_RDWR APFS decompression penalty you mentioned.
  • Applied the extensions to both NIOFS and _NIOFileSystem.

Let me know if you want any specific unit tests added or if this looks good to go! 🚀

@glbrntt glbrntt left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This contains changes unrelated to the description; can you remove them? There are also no tests for the changes being made.

@wasim-builds
wasim-builds force-pushed the feat/issue-3648-oneshot-attributes branch from 829a6fb to 106e3cc Compare July 24, 2026 14:39
@wasim-builds

Copy link
Copy Markdown
Contributor Author

Thanks for the review! I've removed the unrelated commit and added test cases in FileSystemTests.swift to cover setTimes, setLastAccessTime, and setLastDataModificationTime. Let me know if everything looks good now! 🚀

@wasim-builds
wasim-builds force-pushed the feat/issue-3648-oneshot-attributes branch from 106e3cc to ba8aeea Compare July 27, 2026 07:04
@wasim-builds

Copy link
Copy Markdown
Contributor Author

Hey @glbrntt! I've rebased the branch to remove the stacked commits — this PR now only contains the FileSystem one-shot attribute methods (with tests). Ready for another look, thanks!

@wasim-builds

Copy link
Copy Markdown
Contributor Author

@glbrntt Following up on your review — Ive removed the unrelated changes and added tests covering all three one-shot attribute methods. Could you take another look when you get a chance?

@wasim-builds
wasim-builds force-pushed the feat/issue-3648-oneshot-attributes branch 2 times, most recently from 26e5b2f to ff6c083 Compare July 29, 2026 13:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants