Hi there,
I have discovered that the behavior of file copying has changed starting from iOS 18.4.
When using FileManager.copyItem(atPath:toPath:)
to copy a directory specified as an argument, whether or not there is a trailing slash ('/') affects whether the copy process works correctly.
The same process operates as expected in the iOS 18.3.1 Simulator.
Is this the correct behavior, or could it be a bug?
The application's build environment is Xcode 16.2.
Below is an example of the code. In practice, the file copying is performed within the application's folder.
// Both iOS 18.3.1 and iOS 18.4 successfully complete the copy process.
FileManager.default.copyItem(atPath: "/path/from/dirA", toPath: "/path/to/dirB")
FileManager.default.copyItem(atPath: "/path/from/dirA/", toPath: "/path/to/dirB/")
// iOS 18.3.1 successfully complete the copy process, but iOS 18.4 fails.
FileManager.default.copyItem(atPath: "/path/from/dirA/", toPath: "/path/to/dirB")
I hope this helps Apple engineers and other developers experiencing the same issue. Feedback or additional insights would be appreciated.