Hi,
I hope this isn't off-topic.
I have a few files which I would like to share to some housemates, but I
don't want these files to be opened by everyone at the same time. (limit
stress on my PC etc)
So, what I would like to do is some sort of library checkout mechanism.
I'm hoping to be able to write a script that will check how many
instances of the file is already in use.
My initial thinking is to use lsof.
eg: lsof | grep -i exact_filename | wc -l
and count the number of times it occurs, compare it to a database(?)
(this is most likely to be just a txt file) and see if I will permit the
connection.
Is lsof a suitable/accurate tool? I mean, based on linux's
architechture, one can still access/stop playing the file( but didn't
close the orig app that played/used it)
Comments please?
(Preferably a command line app / solution)
--
Ow Mun Heng
Gentoo/Linux on DELL D600 1.4Ghz 1.5GB RAM
98% Microsoft(tm) Free!!
Neuromancer 15:26:22 up 1:53, 5 users, load average: 0.78, 0.78, 0.65
--
[email protected] mailing list