Sponsored Content
Top Forums UNIX for Advanced & Expert Users How to list locked file in unix? Post 302275088 by ashokd001 on Friday 9th of January 2009 08:29:33 AM
Old 01-09-2009
How to list locked file in unix?

Hi,
I want to list out all files which are lock by some process.

ex- ~/critical

I want to list all files in critical directory which has been locked.
I need this very badly. Any suggestion highly appriciated.


Regards,
Ashok
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

How can a file be locked for a certain time?

I want to be able to lock a file for 60 minutes so that an automated monitoring program will not execute the script more that once an hour. I have never used a lock file but have heard that is what I need to use. Does anyone have any examples of how I would use this? lock 60 filename.ksh ---?... (6 Replies)
Discussion started by: darthur
6 Replies

2. UNIX for Dummies Questions & Answers

list of active and locked OS accounts

Hello all I'm trying to generate a list of active and locked accounts at the end of every month...How would I know which account is active and which is locked or diabled ...I was looking at the /etc/passwd file but I was not sure how to differentiate between an active account and a locked... (4 Replies)
Discussion started by: luft
4 Replies

3. Shell Programming and Scripting

checking whether a file is locked

hi Guys, I just wondering how I can check and ensure a file is not locked by another process. I need to modify a file using sed but I need to ensure that is not being modified by another process at the same time. Thanks. Harby. (2 Replies)
Discussion started by: hariza
2 Replies

4. UNIX for Dummies Questions & Answers

find locked files, print file path, unlock file

using OS X and the Terminal, I'd like to find all locked files in a specified directory, unlock them, and print a list of those files that were unlocked how can I do this? I'm familiar with chflags nouchg for unlocking one file but not familiar with unix enough to do what I'd like. Thanks! (0 Replies)
Discussion started by: alternapop
0 Replies

5. HP-UX

how to list locked users in hp-ux?

Actually.I have 2 questions to ask. 1. how to list locked account in hp-ux? 2.how to list locked account in linux(redhat)? I can use the command "passwd -S -username" to list a account who were locked . who knows how to list all locked accounts with one command. Thanks!! (5 Replies)
Discussion started by: robbiezr
5 Replies

6. UNIX for Dummies Questions & Answers

How do i list all locked account in linux?

Hi How do i list all locked account in my linux distributiion I have tried passwd -S -a but it seems to not working . My distribution details. # lsb_release -a LSB Version: :core-3.1-ia32:core-3.1-noarch:graphics-3.1-ia32:graphics-3.1-noarch Distributor ID: OracleVMserver... (3 Replies)
Discussion started by: pinga123
3 Replies

7. Shell Programming and Scripting

Check if file is locked otherwise gzip it

Dear community, I've a continuos tcpdump on redhat that close the dumped file every 100000 captured packets. To avoid disk full I would like to gzip the closed *.cap file. But how can I check if the file is currently opened by tcpdump and skip it from gzip? Thanks! EDIT: Just to post an... (9 Replies)
Discussion started by: Lord Spectre
9 Replies

8. UNIX for Dummies Questions & Answers

UNIX Account getting Locked Everyday between same Time Frame

I am facing an Issue with a particular Unix Account ( ie a particular Userid) getting LOCKED everyday between 7:30am and 8:00am. The Password associated with this particular Account has been setup such that it should never Expire at all but it does LOCK the Account after more than 3 failed... (5 Replies)
Discussion started by: pchegoor
5 Replies

9. Shell Programming and Scripting

How to kill the process when the file is locked?

I was trying to read the file to create a table in SAS and I got error as follows while I read. Resource is write-locked by another user. File =/usr/sas/sas_config/Lev1/SASApp/StoredProcessServ​er/Logs/SASApp_STPServer_2015-09-29_tmp_18208.log. System Error Code = 0. ERROR: File is in... (10 Replies)
Discussion started by: Ram Kumar_BE
10 Replies

10. Shell Programming and Scripting

How to check the file locked or in use at FTP?

Hi Experts, I am beginner to shell scripting, I have a archive script which will connect to the FTP server and archive the files from FTP source location to FTP archive location. Now the problem here is, the script working for few files and not working for few.I am facing the below error... (1 Reply)
Discussion started by: spidy
1 Replies
_lwp_mutex_lock(2)						   System Calls 						_lwp_mutex_lock(2)

NAME
_lwp_mutex_lock, _lwp_mutex_unlock, _lwp_mutex_trylock - mutual exclusion SYNOPSIS
#include <sys/lwp.h> int _lwp_mutex_lock(lwp_mutex_t *mp); int _lwp_mutex_trylock(lwp_mutex_t *mp); int _lwp_mutex_unlock(lwp_mutex_t *mp); DESCRIPTION
These functions serialize the execution of lightweight processes. They are useful for ensuring that only one lightweight process can exe- cute a critical section of code at any one time (mutual exclusion). LWP mutexes must be initialized to 0 before use. The _lwp_mutex_lock() function locks the LWP mutex pointed to by mp. If the mutex is already locked, the calling LWP blocks until the mutex becomes available. When _lwp_mutex_lock() returns, the mutex is locked and the calling LWP is the "owner". The _lwp_mutex_trylock() function attempts to lock the mutex. If the mutex is already locked it returns with an error. If the mutex is unlocked, it is locked and _lwp_mutex_trylock() returns. The _lwp_mutex_unlock() function unlocks a locked mutex. The mutex must be locked and the calling LWP must be the one that last locked the mutex (the owner). If any other LWPs are waiting for the mutex to become available, one of them is unblocked. RETURN VALUES
Upon successful completion, 0 is returned. A non-zero value indicates an error. ERRORS
If any of the following conditions are detected, _lwp_mutex_lock(), _lwp_mutex_trylock(), and _lwp_mutex_unlock() fail and return the cor- responding value: EINVAL The mp argument points to an invalid LWP mutex. EFAULT The mp argument points to an illegal address. If any of the following conditions occur, _lwp_mutex_trylock() fails and returns the corresponding value: EBUSY The mp argument points to a locked mutex. SEE ALSO
intro(2), _lwp_cond_wait(2) SunOS 5.10 30 Jul 1992 _lwp_mutex_lock(2)
All times are GMT -4. The time now is 12:33 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy