开发者

copy a folder in resource

开发者 https://www.devze.com 2022-12-18 15:51 出处:网络
I am developing an application in cocoa which needs to copy a folder added to resource to other location in System/library .How can i specify the source and destination path.Looking for a solutio开发者

I am developing an application in cocoa which needs to copy a folder added to resource to other location in System/library .How can i specify the source and destination path.Looking for a solutio开发者_JAVA百科n

Thanks in advance


I am developing an application in cocoa which needs to copy a folder added to resource to other location in System/library .

  1. It sounds like you're writing an installer. Use PackageMaker; don't write your own custom installer. There are a thousand edge cases that Installer already handles and your custom installer will not.
  2. Do you really need to install this file in /System? The only kind of thing that absolutely needs to be there is a driver. If what you're installing is anything else, the answer is no, and you should not install it to /System.


You'd use NSFileManager which has really nice convenient methods. There is method like

- (BOOL)copyItemAtPath:(NSString *)srcPath toPath:(NSString *)dstPath error:(NSError **)error

And here's the description of it from apple docs:

Copies the directory or file specified in a given path to a different location in the file system identified by another path.

0

精彩评论

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