Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
find locked files - lslk?
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware
View previous topic :: View next topic  
Author Message
darkphader
Veteran
Veteran


Joined: 09 May 2002
Posts: 1217
Location: Motown

PostPosted: Fri Apr 19, 2013 3:16 pm    Post subject: find locked files - lslk? Reply with quote

Apparently there's a utility - lslk - to display locked files, but it isn't in portage. Is there a better and/or alternate way to do this?

Thanks,

Chris
_________________
WYSIWYG - What You See Is What You Grep
Back to top
View user's profile Send private message
Mad Merlin
Veteran
Veteran


Joined: 09 May 2005
Posts: 1155

PostPosted: Fri Apr 19, 2013 10:16 pm    Post subject: Reply with quote

What do you need this for? "Locked" files aren't really locked, as Linux uses advisory locking, not mandatory. In other words, the lock will only matter if another program tries to lock the file, which is not normally done. You can delete/modify/whatever the file without waiting for it to be unlocked.

Having said that, to have a lock on a file, the process must have the file open, so lsof (which lists open files) could tell you what you're looking for, provided you know either the program locking the files, or the files that it's locking.

Edit: Apparently lsof can even tell you about lock information on an fd, so there you go.
_________________
Game! - Where the stick is mightier than the sword!
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum