Re: Accessing information from applications
Re: Accessing information from applications
- Subject: Re: Accessing information from applications
- From: James Montgomerie <email@hidden>
- Date: Thu, 02 Jun 2011 11:54:01 -0700
Note that, depending on what you're wanting to do, this might not actually give you what you want (and getting what you want may be impossible). Lots of apps (word processors etc.) that have document files 'open' as far as the user is concerned actually open the file, read/unarchive it into memory, close it, then use the in-memory representation while the document is displayed.
Jamie.
On 2 Jun 2011, at 11:29, Jens Alfke wrote:
>
> On Jun 2, 2011, at 11:18 AM, Abhinav K Tyagi wrote:
>
>> Is there any method to know what files are opened by any application?
>
> I think you have to use fairly low-level POSIX or BSD APIs. The tool /usr/bin/lsof does this; you could get its source code from the Darwin repository (opensource.apple.com) and see how it does it. (Or more clumsily, you could use NSTask to invoke lsof and parse its output.)
>
> This is kind of off-topic for the Cocoa list, though. People on lists like darwin-userlevel might know more.
>
> —Jens=
> _______________________________________________
>
> 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
_______________________________________________
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