Re: locking a file in linux .. Havent tried it as yet

2002-09-09 Thread Mark Goland
> Sent: Monday, September 09, 2002 3:23 AM Subject: Re: locking a file in linux .. Havent tried it as yet > But sir > >Will I be able to myself write into a file when I have locked it > > > > > Mark Goland wrote: > > >This will do mandetory locking { which c

Re: locking a file in linux

2002-09-09 Thread Mark Goland
Thanx John, I have not tested it yet, but it looks right...will give it a try 2nite. Mark - Original Message - From: "John W. Krahn" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Monday, September 09, 2002 7:35 AM Subject: Re: locking a file in linux

Re: locking a file in linux

2002-09-09 Thread John W. Krahn
Mark Goland wrote: > > This will do mandetory locking { which can also be done with "chmod +l > filename"}. If someone can rewrite this into perl , that would be great. > > /* >write by Mark Goland use and enjoy keep the tag >[EMAIL PROTECTED] > */ > > #include > #include > int main(

Re: locking a file in linux

2002-09-08 Thread Mark Goland
<[EMAIL PROTECTED]>; "Michael Fowler" <[EMAIL PROTECTED]> Cc: <[EMAIL PROTECTED]> Sent: Wednesday, September 04, 2002 2:49 AM Subject: Re: locking a file in linux > Michael Fowler wrote: > > On Mon, Sep 02, 2002 at 03:56:22PM +0530, Ramprasad A Padmanabhan wrote: >

Re: locking a file in linux

2002-09-04 Thread david
this is still better than checking for a .swp file. some editor never uses any .swp files and doesn't even know the fact that another editor is opened and is editing the same file at the same time. what he can do is change: next unless $p->cmndline =~ /vi.*tmp\.pl/; the above line to include s

Re: locking a file in linux

2002-09-04 Thread Sudarshan Raghavan
On Wed, 4 Sep 2002, Ramprasad A Padmanabhan wrote: > Thanx All >But I will still like to have kernel enforced mandatory locking on > the file Can you tell me how to do it For starters your kernel must support mandatory locking, after checking that you will have to unmount the filesystem, e

Re: locking a file in linux

2002-09-03 Thread Ramprasad A Padmanabhan
Michael Fowler wrote: > On Mon, Sep 02, 2002 at 03:56:22PM +0530, Ramprasad A Padmanabhan wrote: > >>Hi All, >> I am writing an web application where multiple users may write into >>the same file concurrently. Also there is a probability that there may >>be an admin who has opened up the file

Re: locking a file in linux

2002-09-03 Thread Wiggins d'Anconia
This is an interesting proposed solution. But as the poster pointed out depends on whether they are *only* using vi, if that can be assured then you might consider using the method by which vi does its own checking on its own files. In other words check for a "..swp" or maybe a "..sw*" file i

Re: locking a file in linux

2002-09-03 Thread Michael Fowler
On Mon, Sep 02, 2002 at 03:56:22PM +0530, Ramprasad A Padmanabhan wrote: > Hi All, > I am writing an web application where multiple users may write into > the same file concurrently. Also there is a probability that there may > be an admin who has opened up the file in 'vi' and editing the fil

Re: locking a file in linux

2002-09-03 Thread david
the tricky part is the "admin who has opened up the file in 'vi' and editing the file". this kind of manually open editing behavior is hard to track for the locking module that you just mention. the following provides you with a simple(not perfect at all and it's slow) method and it searches you

Re: locking a file in linux

2002-09-02 Thread Sudarshan Raghavan
On Mon, 2 Sep 2002, Ramprasad A Padmanabhan wrote: > Hi All, >I am writing an web application where multiple users may write into > the same file concurrently. Also there is a probability that there may > be an admin who has opened up the file in 'vi' and editing the file. > >I want to

locking a file in linux

2002-09-02 Thread Ramprasad A Padmanabhan
Hi All, I am writing an web application where multiple users may write into the same file concurrently. Also there is a probability that there may be an admin who has opened up the file in 'vi' and editing the file. I want to avoid this concurrent multiple opens. I tried a range on perl