lock on files

Hi,
I want to write a code where in the file once taken genrates a lock number and other developer/user cannot take the file to make any changes in it. He gets the file only as read only.

how about your develope platfrom? in shell ? (file system rights ?)
maybe can try cvs solutions for versioning files and set the permissions on thats (file or code)

$ man sccs