On Apr 28, 2010, at 11:16 AM, Tom Foutz wrote:
I am trying to run a back-up type of unix script whenever a file changes in the directory. However, my implementation, when viewed in "Instruments" with "ObjectAlloc", demonstrates an ever-increasing number of living objects.
Isn't that because you're spawning new NSTasks in a tight loop, probably faster than they can complete? This type of situation is sometimes used as an attack called a "fork bomb" :)
Your problem might be that you're expecting -[NSTask launch] to be synchronous, i.e. wait for the task to complete. It isn't. If you want to block, you should call -waitUntilExit; although usually it's better to take advantage of NSTask's asynchronous nature and avoid clogging up your app's UI.
—Jens_______________________________________________ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com