Skip to content

Add the replaceExisting to the _NIOFileSystem copyItem#3535

Merged
glbrntt merged 10 commits intoapple:mainfrom
stepan-ulyanin:port-more-niofs-logic
Mar 9, 2026
Merged

Add the replaceExisting to the _NIOFileSystem copyItem#3535
glbrntt merged 10 commits intoapple:mainfrom
stepan-ulyanin:port-more-niofs-logic

Conversation

@stepan-ulyanin
Copy link
Copy Markdown
Contributor

@stepan-ulyanin stepan-ulyanin commented Mar 3, 2026

Adds the changes from #3508 to the _NIOFileSystem.

Motivation:

We have added capability to overwrite regular files and symbolic links to NIOFS FileSystem.copyItem in #3508. Now we want to port the same logic to _NIOFileSystem.

Modifications:

  • Adds a new FileSystemProtocol.copyItem requirement with replaceExisting: bool parameter along with a default implementation.
  • Adds an implementation of the new FileSystemProtocol.copyItem requirement to _NIOFileSystem's FileSystem struct for regular files and symbolic links.

Notes

It seems that the tests for FileSystem are only in NIOFS - so no tests are added in this PR.

@glbrntt glbrntt added the 🆕 semver/minor Adds new public API. label Mar 6, 2026
@stepan-ulyanin stepan-ulyanin marked this pull request as ready for review March 6, 2026 20:41
@glbrntt glbrntt merged commit 182ae0b into apple:main Mar 9, 2026
50 of 55 checks passed
@glbrntt
Copy link
Copy Markdown
Contributor

glbrntt commented Mar 9, 2026

The nightly failures are unrelated. The API breakage is expected and okay here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

🆕 semver/minor Adds new public API.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants