I was thinking, is a best practice for writing an OSX program that copies files from one place to another Does it or does the trick?
- Is there some nssopping method that I can call?
- Do I have to work with input / output streams?
- Or maybe the best way
Bonus question: How can I get a "copy 12% complete" with one of these methods?
Thank you for your help!
There are ways to move, copy, and delete both the NSFileManager and NSWorkspace files. Usually you use NSFileManager because it's easy to work with:
if ([[NSFileManager defaultManager] is readableFileAtPath: source]) [[NSFileManager defaultManager] copyItemAtURL: source toURL: destination Error: zero];
However, NSWorkspace can easily move files to Trash, which NSFileManager can not do.
[[NSWorkspace sharedWorkspace] performFileOperation: NSWorkspaceRecycleOperation Source: Folder name Destination: @ "" Files: FilenameAir Tags: & amp; Tag];
Check the document for a complete description of the two sections. (,)
Comments
Post a Comment