开发者

What is the difference between copyItemAtPath:toPath:error and copyItemAtURL:toURL:error: of NSFileManager?

开发者 https://www.devze.com 2023-02-12 00:34 出处:网络
I want to copy a file at path A to path B, in case it exists at B I want it to be overwritten and I want to use one of the mentioned methods but which one is the one I should use?

I want to copy a file at path A to path B, in case it exists at B I want it to be overwritten and I want to use one of the mentioned methods but which one is the one I should use? I saw their documentation and they say pretty much the same.

I can make NSURL objects from strings so both d开发者_如何学编程o the same?


Cocoa is attempting to standardize on URLs. Consistent use of URLs can in some cases improve performance, because an NSURL object can cache some information from the filesystem and avoid redundant IO in the case that the information is requested again.

However, in the context of just this one method by itself, it doesn't really make any difference.

0

精彩评论

暂无评论...
验证码 换一张
取 消