Re: Design question
Re: Design question
- Subject: Re: Design question
- From: James Bucanek <email@hidden>
- Date: Thu, 27 Apr 2006 11:19:03 -0700
Marcus S. Zarra wrote on Thursday, April 27, 2006:
>However, when an application is using Core Data it should be the only
>application accessing that file on the disk. Therefore it appears
>that I need a way to determine whether the helper application is
>running or not. If I am wrong at this point, please let me know!
>
>My first thought is when either the GUI app starts up or the helper
>starts up they check to see if the other is running. This seemed a
>little low level to me and might run into an issue of two people
>using the app on the same computer.
Why can't you simply check to see if the file in question is open by another process for exclusive access? If it is, it really doesn't matter if it's your other application or not -- what you are about to attempt is not going to work.
Now, if you want one of your applications to back off and close the file if the other one starts and needs access to it, then I'd suggest opening a message port whenever your application starts. When the other application starts, it checks to see if it can access the file. If not, it can try to connect with the port of the first application and ask it to back off. If that fails, it will have to die gracefully.
--
James Bucanek
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden