Implementing progress on a file system copy operation is tricky because you have to walk the directory hierarchy twice, once to build a progress target and then again to actually do the copy.
NSFileManager
doesn’t do that, because doing so would slow things down in the case where progress isn’t required. However, you could imagine a world where it would be possible to opt in to this, one where
NSFileManager
was nicely integrated with
NSProgress
. If you’d like to see such support added in the future, I encourage you to file an
enhancement request describing your requirements. Please post your bug number, just for the record.
In the meantime, if you need this feature you’ll have to implement it yourself. This is quite tricky in the general case — for example, the cost of copying a large file varies radically depending on whether the volume in question supports cloning — so it’d help if you could make some simplifying assumptions.
Are you copying large directory hierarchies? Or just specific files?
Share and Enjoy
—
Quinn “The Eskimo!”
Apple Developer Relations, Developer Technical Support, Core OS/Hardware
let myEmail = "eskimo" + "1" + "@apple.com"