Linux Forums - Linux Help,Advice & support community:LinuxSolved.com

Linux Software => Linux Application => Topic started by: chuikingman on August 31, 2009, 10:32:39 AM

Title: lock the file in linux
Post by: chuikingman on August 31, 2009, 10:32:39 AM
Hi,

  I want to lock the file in linux and the file cannot be edit or modify by other .I know in perl, there is function flock , but it is not worked.

The file can be modifed and edit even if it is locked by flock .

Any other way to lock the file and so other cannot edit or modifed it ????

Any similar fucntion in perl ????



thank

Title: Re: lock the file in linux
Post by: gauravbajaj on September 02, 2009, 04:47:39 AM
I belive there is special attributes for this


check  the below command:

ltattr and chattr

I think its somewhat  related to the query what u are asking for.
Title: Re: lock the file in linux
Post by: chuikingman on September 02, 2009, 04:53:27 AM
I know the linux comand lsattr and chattr .
but there is no similar function in perl ....
I want to implement in perl script .....
Please advice and suggest !!
Title: Re: lock the file in linux
Post by: chuikingman on September 02, 2009, 10:52:48 AM
Any suggestion how to make the "file busy" error by perl script in linux ???
Any idea ???