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
Ns_CritSec(3aolserver)					   AOLserver Library Procedures 				    Ns_CritSec(3aolserver)

__________________________________________________________________________________________________________________________________________________

NAME
, Ns_CsDestroy, Ns_CsEnter, Ns_CsInit, Ns_CsLeave - Manage and use critical section locks SYNOPSIS
#include "ns.h" void Ns_CsDestroy(Ns_Cs *csPtr) void Ns_CsEnter(Ns_Cs *csPtr) void Ns_CsInit(Ns_Cs *csPtr) void Ns_CsLeave(Ns_Cs *csPtr) _________________________________________________________________ DESCRIPTION
Critical section locks are used to prevent more than one thread from executing a specific section of code at one time. They are implemented as "objects", which simply means that memory is allocated to hold the lock state. They can also be called "sychronization objects". While a thread is executing a critical section of code, all other threads that want to execute that same section of code must wait until the lock surrounding that critical section has been released. This is crucial to prevent race conditions which could put the server into an unknown state. For example, if a section of code frees a pointer and then decrements a counter that stores how many pointers exist, it is possible that the counter value and the actual number of pointers may be different. If another section of the server relies on this counter and reads it when the pointer has been freed, but the counter has not yet been decremented, it could crash the server or put it into an unknown state. Critical section locks should be used sparingly as they will adversely impact the performance of the server or module. They essentially cause the section of code they enclose into behaving in a single-threaded manner. If a critical section executes slowly or blocks, other threads that must execute that section of code will begin to block as well until the critical section lock is released. You will normally want to wrap sections of code that are used to both read and write values, create and destroy pointers and structures or otherwise look at or modify data in the system. Use the same named lock for both read and write operations on the same data. Threads that are waiting for a critical section lock to be released do not have to poll the lock. The critical section lock functions use thread condition functions to signal when a lock is released. Ns_CsDestroy(csPtr) Destroy a critical section object. Note that you would almost never need to call this function as synchronization objects are typi- cally created at startup and exist until the server exits. The underlying objects in the critical section are destroyed and the critical section memory returned to the heap. Ns_CsEnter(csPtr) Lock a critical section object, initializing it first if needed. If the critical section is in use by another thread, the calling thread will block until it is no longer so. Note that critical sections are recursive and must be exited the same number of times as they were entered. Ns_CsInit(csPtr) Initialize a critical section object. Memory will be allocated to hold the object's state. Ns_CsLeave(csPtr) Unlock a critical section once. A count of threads waiting to enter the critical section is kept, and a condition is signaled if this is the final unlock of the critical section so that other threads may enter the critical section. SEE ALSO
nsd(1), info(n), Ns_MasterLock(3), Ns_MasterUnlock(3), Ns_CondDestroy(3), Ns_CondSignal(3), Ns_CondWait(3), Ns_MutexLock(3), Ns_MutexUn- lock(3) KEYWORDS
AOLserver 4.0 Ns_CritSec(3aolserver)
All times are GMT -4. The time now is 10:10 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy