Re: Is a file open in another application?
Re: Is a file open in another application?
- Subject: Re: Is a file open in another application?
- From: Frédéric Testuz <email@hidden>
- Date: Sat, 19 Mar 2011 20:58:13 +0100
Le 19 mars 2011 à 20:03, Kyle Sluder a écrit :
> On Sat, Mar 19, 2011 at 11:40 AM, Conrad Shultz
> <email@hidden> wrote:
>> Are you certain that is a general behavior?
>
> 1. Open TextEdit.
> 2. Type some stuff.
> 3. Save As > /tmp/somefile.rtf
> 4. `lsof |grep somefile` prints nothing.
>
>> For example, I have Preview open right now, and it very much lists all
>> its open files:
>
> Preview probably mmaps the file contents. And that could even be done
> by PDFKit or NSImage, not explicitly by the application.
>
>> But it does seem from the above that this can be handled in an
>> implementation-specific manner, no? (Please forgive my ignorance, I
>> develop mostly with iOS.)
>
> I don't think a general solution exists for Brad's problem.
I can't think of a general solution, but IIRC Brad is only interested about Word and Excel. These applications have AppleScript support.
I'm sure he can ask Word by AppleScript for the open documents. He had to check if Word can also return the path of the file for these documents.
--
Frédéric Testuz_______________________________________________
Cocoa-dev mailing list (email@hidden)
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:
This email sent to email@hidden