Files
Stepan Ulyanin 182ae0b4f9 Add the replaceExisting to the _NIOFileSystem copyItem (#3535)
Adds the changes from https://github.com/apple/swift-nio/pull/3508 to
the `_NIOFileSystem`.
### Motivation:

We have added capability to overwrite regular files and symbolic links
to `NIOFS` `FileSystem.copyItem` in
https://github.com/apple/swift-nio/pull/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.
2026-03-09 10:59:41 +00:00
..