Linux Software > Linux Application

lock the file in linux

(1/1)

chuikingman:
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

gauravbajaj:
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.

chuikingman:
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 !!

chuikingman:
Any suggestion how to make the "file busy" error by perl script in linux ???
Any idea ???

Navigation

[0] Message Index

Go to full version