Have you looked at fstat? https://man.openbsd.org/fstat.1
Sent from mobile. Original Message From: Edward Lopez-Acosta Sent: Thursday, August 9, 2018 16:30 To: Ingo Schwarze Cc: [email protected] Subject: Re: lsof alternative for listing open files? Hi Ingo, I was looking to port bleachbit, system cleanup tool, to OpenBSD and one function is to make sure certain files are not in use before it proceeds. An example would be cache files by a browser which would need closed. Beyond that though it was more of an educational exercise on my part as I continue becoming familiar with OpenBSD and its workings. Edward Lopez-Acosta On 8/9/18 6:17 PM, Ingo Schwarze wrote: > Hi Edward, > > Edward Lopez-Acosta wrote on Thu, Aug 09, 2018 at 05:41:04PM -0500: > >> I am aware of fuser and fstat but these seem to only give me inodes. >> Is there an equivalent to the Linux application `lsof`? > > $ pkg_add lsof > Obsolete package: lsof (ancient software that doesn't work) > > Once a process has a file open, there is no was to get back from > the file descriptor to a file name. Actually, the file name may > have changed since the file was opened, or the file may not have > any name whatsoever any longer, or the name might now point to a > different file that is not open. It is by design that you cannot > translate an inode number back to a filename. I have no idea what > the Linux kernel is doing with symbolic links like /proc/21325/fd/3, > but i doubt that it makes much sense. > > What is the actual problem you are trying to solve? > > Yours, > Ingo >

