views:

189

answers:

1

I am planning to convert a rather long shell script I have into an Objective C command line tool. I'm planning to use NSTask to run the shell commands (this is a large script, and it has several thousand copy/move/delete operations). My question is, will continually allocating and deallocating NSTask objects to run all these commands result in a large performance hit?

Is there a better way to do it than using NSTask?

Thanks

+3  A: 

If you're just moving/copying/deleting files, have you considered using NSFileManager?

mipadi
I forgot to mention also that I need to set permissions on files. Is that possible with NSFileManager?
macatomy
Assuming the CLI is running with the perms to do so, then yes. It's in `-[NSFileManager setAttributes:ofItemAtPath:error:]`.
Dave DeLong