• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Identify all open files of current OS X process
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Identify all open files of current OS X process


  • Subject: Re: Identify all open files of current OS X process
  • From: Alex Zavatone <email@hidden>
  • Date: Sun, 08 Feb 2015 09:02:23 -0500

Any idea what the Activity Monitor application uses for the Open Files and Ports when you inspect an application/process?


On Feb 7, 2015, at 6:26 PM, Jerry Krinock wrote:

> I need a method which will give me the paths of all files which the current OS X process (*) has open.  Yes, this is for a benevolent hack and no, I am not sandboxed.
>
> I’m considering using getpid() and passing the result to /usr/sbin/lsof with a -p option.  This works very fast in Terminal.app, but I’m hoping for something less fragile (lsof has lots of weird options including a timeout) and more lightweight.
>
> Thanks,
>
> Jerry Krinock
>
> (*) Actually, this code is going in to a binary plug-in in another app, so my plug-in is going to get the open files of its host app.  The purpose is to work around a deficiency in the host app’s plug-in API.
> _______________________________________________
>
> 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


References: 
 >Identify all open files of current OS X process (From: Jerry Krinock <email@hidden>)

  • Prev by Date: Re: Trying to create a circular button with image, but the image wasn't clipped automatically
  • Next by Date: Re: [CIImageAccumulator image]: getting the BMP representation destroys the image contents
  • Previous by thread: Re: Identify all open files of current OS X process
  • Next by thread: Re: Identify all open files of current OS X process
  • Index(es):
    • Date
    • Thread