![]() |
|
|
|
|
|||||||
| Forums | Portal | Register | Forum Rules | FAQ | Contribute | Members List | Arcade | Search | Today's Posts | Mark Forums Read |
| UNIX for Advanced & Expert Users Advanced UNIX and Linux questions go here. Expert-to-Expert. |
|
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Locking in Unix? | nguoidoius | UNIX for Dummies Questions & Answers | 1 | 01-23-2008 10:50 PM |
| ftp account locking | morgadoa | SUN Solaris | 5 | 10-19-2007 06:47 AM |
| Locking a file in ksh | thanuman | UNIX for Dummies Questions & Answers | 1 | 04-27-2005 08:01 AM |
| File Locking | penfold | UNIX for Advanced & Expert Users | 1 | 04-11-2005 09:47 AM |
| System Locking Up | mcrawfo4 | SCO | 1 | 02-21-2005 01:31 PM |
|
|
Submit Tools | LinkBack | Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
|
Locking issue
Hi everyone,
I have got a requirement that, i need to check a specific folder,say /test/lock/ for few specific files, say *lock*, whether it has been locked or not.If any one of it is locked than i need to delete that file after a specific time, say after 10 minutes. I never have worked on such type of program earlier.Can anyone please help me to create a program like this? Thanks in advance. Regards Susant |
| Forum Sponsor | ||
|
|
|
#2
|
|||
|
|||
|
Code:
dir=/test [[ -f $dir/lock ]] && sleep 600 && rm -f ./tmp/lock |
|
#3
|
|||
|
|||
|
Just to point out the obvious, you mean "rm -f $dir/lock" at the end.
|
|
#4
|
|||
|
|||
|
Thnnx sa lot for quick reply
Thnnx sa lot for quick reply
Regards Susant |
|
#5
|
|||
|
|||
|
Hi Jim,
I have a similar requirement which is basically to detect whether a file ie being locked before I can go and modify it. Is there any possible and simple way that I can check that the file is not being locked by another process. thanks a lot. Harby. |
|||
| Google The UNIX and Linux Forums |