Hi Ow, on Tuesday, 2006-01-03 at 15:37:55, you wrote: > 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.
Depends on what protocol you want these files shared over. I don't think there's any way short of hacking the source to implement this with NFS of Samba. If you use HTTP, it should be fairly easy to write a little CGI script that keeps a counter of downloaders for each file in some kind of lock-file. However, I doubt you need this anyway. Due to the way Linux's buffer cache works it's actually likely to cause less stress on your HD when everybody is reading the same file than when the same number of readers each read a different file. Of course it may make sense to limit the total number of readers with something like Samba's "max connections". regards Matthias -- I prefer encrypted and signed messages. KeyID: FAC37665 Fingerprint: 8C16 3F0A A6FC DF0D 19B0 8DEF 48D9 1700 FAC3 7665
pgpGsoeu8l7VK.pgp
Description: PGP signature