File locking from shell

File locking from shell

Post by Soren Dayt » Mon, 09 Oct 1995 04:00:00




Quote:

> Hi, is it possible to lock files from csh or sh?

        Yes.  You can use lockfile(1) from the procmail distribution.

        Alternatively, you can simply create a file and check to see if it
exists...  If it does, it is locked.  

Soren

 
 
 

File locking from shell

Post by Stan Ryckm » Mon, 09 Oct 1995 04:00:00





>> Hi, is it possible to lock files from csh or sh?

>    Yes.  You can use lockfile(1) from the procmail distribution.

>    Alternatively, you can simply create a file and check to see if it
>exists...  If it does, it is locked.  

Uhh.  Maybe it exists because a user terminated two days ago and
left it around.

Or maybe it doesn't exist, and race conditions will allow two
users "in" anyway.

Not very safe.

Cheers,
Stan.
--
HELP!  I'M BEING HELD PRISONER IN A .SIGNATURE FACTORY!


 
 
 

File locking from shell

Post by Dana Frenc » Mon, 09 Oct 1995 04:00:00




>> Hi, is it possible to lock files from csh or sh?

>    Yes.  You can use lockfile(1) from the procmail distribution.

>    Alternatively, you can simply create a file and check to see if

procmail ???  never heard of it.  what is it?

--

Applied Intelligence Group                        Phone: (405) 341-7700
501 East 15th Street, Suite 202                     Fax: (405) 341-8898
Edmond, OK  73013

 
 
 

File locking from shell

Post by Satya Ranjan Da » Mon, 09 Oct 1995 04:00:00


Hi, is it possible to lock files from csh or sh?  There are some
group files I have which can be edited by any group member. However,
at any single moment it is necessary to restrict to one user. I am
unable to find anything in "man 1".  Any pointers? Is there some round
about way to achieve this functionality?

--
Cheers.                                                         Dash

 
 
 

File locking from shell

Post by Harald Hanche-Ols » Tue, 10 Oct 1995 04:00:00


[Satya Ranjan Dash]

|   Hi, is it possible to lock files from csh or sh?  There are some
|   group files I have which can be edited by any group member. However,
|   at any single moment it is necessary to restrict to one user. I am
|   unable to find anything in "man 1".  Any pointers? Is there some round
|   about way to achieve this functionality?

Sounds to me like you really want to use rcs.  Then you will not only
have locking, but you can revert to earlier versions of the file, and
you can tell who did what changes and when.

- Harald

 
 
 

File locking from shell

Post by Soren Dayt » Tue, 10 Oct 1995 04:00:00






> >> Hi, is it possible to lock files from csh or sh?

> >       Yes.  You can use lockfile(1) from the procmail distribution.

> >       Alternatively, you can simply create a file and check to see if it
> >exists...  If it does, it is locked.  

> Uhh.  Maybe it exists because a user terminated two days ago and
> left it around.

> Or maybe it doesn't exist, and race conditions will allow two
> users "in" anyway.
> Not very safe.

        All are true.  I admit that there is no _great_ way to do it...  

Soren

 
 
 

File locking from shell

Post by Howard Goldste » Wed, 11 Oct 1995 04:00:00


If your system has INN you might also use Richard $alz's shlock(1) program
to remove some of the drudgework from creating/testing locks from the
shell.

--  

 
 
 

File locking from shell

Post by Jacques Marco » Thu, 12 Oct 1995 04:00:00





    >>
    >>>  Hi, is it possible to lock files from csh or sh?
    >>  Yes.  You can use lockfile(1) from the procmail distribution.
    >>
    >> Alternatively, you can simply create a file and check to see if

    Dana> procmail ???  never heard of it.  what is it?

From:
http://www.cis.ohio-state.edu/hypertext/faq/usenet/mail/filtering-faq...

Date: 18 Apr 1995 00:02:00 GMT

Procmail is a powerful mail processor that can be used to process your
mail messages either as they arrive or after they are in a mail folder.  
To find out how to process an existing mail folder see the NOTES section
of the procmail(1) man page.

Parent document is top of "Filtering Mail FAQ"
Previous document is " 1.2 Reading Incoming Mail Folders"
Next document is " 2.1 Setting Up Procmail"

--
    _______    _______    _______    _______    _______    _______    _______
 __/\______\__/\______\__/\______\__/\______\__/\______\__/\______\__/\______\
/\_\/______/\_\/______/\_\/______/\_\/______/\_\/______/\_\/______/\_\/______/
\/_/       \/_/       \/_/       \/_/       \/_/       \/_/       \/_/        


 
 
 

1. File Locking in Shell Script

I am looking for a way to tell if a
NFS mounted file is currently in use
with a shell script.  Is there a simple
way to find out if you can write to the
file.  The process that opens the file
doesn't have /tmp/lockfile .pid file.

Thanks,
   Mark

2. Correct value for "idebus=xxxx"?

3. File locking in shell scripts

4. Problems with X Ghostscript

5. file locking in shell scripts

6. Firewire on Cobalt Raq3i

7. File locking with shell scripts

8. Turkish Fonts and Locale

9. File locking using the shell.

10. Using shell script can I implement record locking on file ?

11. How to lock file from shell?

12. SHELL-LOCK - was shell scripts.

13. More mail file locking questions (lockf, NFS, /var/spool/mail/*.lock)