• 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: How to list all files opened by a process on the Mac OS X?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: How to list all files opened by a process on the Mac OS X?


  • Subject: Re: How to list all files opened by a process on the Mac OS X?
  • From: Alexander von Below <email@hidden>
  • Date: Tue, 24 Jan 2006 22:12:31 +0100


Am 24.01.2006 um 21:51 schrieb Mike Smith:

To start with, why are you interested in this information? What do you expect to do with it?

Glad you asked!

I would like to know which files of a certain pattern (say: Extension) are opened by other processes, and I am interested in the full path. Not much else really, maybe the process ID that has opened it. Preferably I would like to do it without root privileges, because I am actually only interested in processes owned by the current user.

Right now, I am calling lsof from my code, and just parse the output. This seems like a pretty wasteful way of achieving what I need.

It would be great to know if there even is a smarter way of doing this. I did succeed in getting a file list from sysctl, but was unsuccessful in reading the corresponding vnodes (I assume that I was I need to obtain the full path)

Thanks a lot

Alex

 = Mike


_______________________________________________ Do not post admin requests to the list. They will be ignored. Darwin-dev mailing list (email@hidden) Help/Unsubscribe/Update your Subscription: This email sent to email@hidden
References: 
 >Re: How to list all files opened by a process on the Mac OS X? (From: Mike Smith <email@hidden>)

  • Prev by Date: Re: How to list all files opened by a process on the Mac OS X?
  • Next by Date: Re: intercepting system calls?
  • Previous by thread: Re: How to list all files opened by a process on the Mac OS X?
  • Next by thread: Obtaining an IOSCSIMultimediaCommandsDevice instance
  • Index(es):
    • Date
    • Thread