On 21 Jul 2016, at 17:20, Graham Cox <graham....@bigpond.com> wrote:
> One of my apps uses NSTask to wrap a command line utility that is embedded in 
> the same app’s resources. This utility writes files to disk - I have no 
> knowledge of which APIs it uses to do this. If the task has ended (and I can 
> see that the actual instance of the running command line tool has disappeared 
> from my process tasks in Activity Monitor), and I send the file to the trash, 
> I can’t delete it (empty trash) until the app as a whole is quit - I get the 
> message that the file is still in use.
> 
> I’ve checked that I’m closing down the NSTask properly, as far as I can see.
> 
> Is this the expected behaviour?

Are you reading all the data from the task (i.e. its standardOutput, not the 
file) before you close it? AFAIR that's a prerequisite for it to properly close.

Cheers,
-- Uli Kusterer
"The Witnesses of TeachText are everywhere..."
http://stacksmith.org





_______________________________________________

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:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to