Re: Identify all open files of current OS X process

2015-02-08 Thread Jerry Krinock
Thank you, Roland. I am using your idea, iterating over fd with > fcntl( fd, F_GETPATH, filePath ) I think that it’s less fragile than what I was thinking of doing, less code, and it works :) On 2015 Feb 07, at 18:59, Roland King wrote: > Well if you can figure out which file descriptors are

Re: Identify all open files of current OS X process

2015-02-08 Thread Jonathan Mitchell
> On 7 Feb 2015, at 23:26, 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

Re: Identify all open files of current OS X process

2015-02-08 Thread Alex Zavatone
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 fo

Re: Identify all open files of current OS X process

2015-02-07 Thread Roland King
> On 8 Feb 2015, at 07:26, 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

Identify all open files of current OS X process

2015-02-07 Thread Jerry Krinock
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,