File Locks

Hi,
How to list the files which are not locked?

I want to read the files that are not locked by other user only.

can we do it using ls option?

At least, I could say that ls command is not really helpful.
But, you can try atime, mtime and ctime to find recently accessed files.
:wink:
lsof could help also.
Good luck.

lsof on HPUX is called fuser. It does not report locked files. In order to find locked files, you have to open() files then try lockf() in C code.

AFAIK HPUX systems only have mandatory file locking on Regular files with the file mode of S_ENFMT.

What are your trying to accomplish?

Just I would like say, that lsof and fuser are different.

lsof does not exist for HPUX unless you install it from the HPUX Porting Centre. Yes, they do not behave the same.

Ok, I aggree.