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 (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/jamie%40montgomerie.net
> 
> This email sent to ja...@montgomerie.net

_______________________________________________

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

Reply via email to