Two users writing to the same file at the same time.
I've set up my system with 15 computers and 60 users so that they have a directory where they all can share files, under /home/staff, I have them belongign to the group teacher who is the owner of /home/staff, and the GUID is set on /home/staff. And I have a problem; If two teachers deceides to work on the same file at the same time, then all changes made by the first to exit will be lost, without him noticing. This situation happens rarly, and when it does they don't know who's to blame (me) and so I've manged to overcome the problem, but I need to solve this. I know CVS, but thats not an option. People I've talked to that know MS say that in MS under the same situation, you'd gett a warning when someone already had that file open, does anything similar exist for linux? They all use OpenOffice.org to write these files. Roy Gratefull for any help I get. -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]
Re: Two users writing to the same file at the same time.
On Sun, 2002-05-05 at 01:55, AE Roy wrote: I've set up my system with 15 computers and 60 users so that they have a directory where they all can share files, under /home/staff, I have them belongign to the group teacher who is the owner of /home/staff, and the GUID is set on /home/staff. And I have a problem; If two teachers deceides to work on the same file at the same time, then all changes made by the first to exit will be lost, without him noticing. This situation happens rarly, and when it does they don't know who's to blame (me) and so I've manged to overcome the problem, but I need to solve this. I know CVS, but thats not an option. People I've talked to that know MS say that in MS under the same situation, you'd gett a warning when someone already had that file open, does anything similar exist for linux? They all use OpenOffice.org to write these files. I'd imagine that OpenOffice has some sort of mechanism built in to handle these sorts of situations (I don't use OpenOffice myself), but in case it doesn't, I'd suggest looking at lockfile. You'd have to handle the opening and closing of the files through a script for this to be effective however. -Alex signature.asc Description: This is a digitally signed message part
Re: Two users writing to the same file at the same time.
Lo, on Saturday, May 4, AE Roy did write: I've set up my system with 15 computers and 60 users so that they have a directory where they all can share files, under /home/staff, I have them belongign to the group teacher who is the owner of /home/staff, and the GUID is set on /home/staff. And I have a problem; If two teachers deceides to work on the same file at the same time, then all changes made by the first to exit will be lost, without him noticing. Yup. Standard race condition. I know CVS, but thats not an option. People I've talked to that know MS say that in MS under the same situation, you'd gett a warning when someone already had that file open, does anything similar exist for linux? They all use OpenOffice.org to write these files. First, why is CVS not an option? Is it because you're working with binary files? Second: AFAIK, no, nothing similar to MS's behavior (``another program already has this file open'') exists for Linux, unless you implement it yourself. It's a fundamental difference in the semantics of the filesystem interface. The Unix/Linux answer is to provide a separate synchronization mechanism to prevent the race condition from occurring. It's up to the appliation. Most version-control systems like CVS, RCS, et al do this. If OpenOffice doesn't provide this functionality already, using some sort of lockfile as another poster suggested is the only other alternative I can think of. HTH, Richard -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]
Re: Two users writing to the same file at the same time.
AE Roy [EMAIL PROTECTED] writes: And I have a problem; If two teachers deceides to work on the same file at the same time, then all changes made by the first to exit will be lost, without him noticing. You might try the suggestions in http://www.openoffice.org/issues/show_bug.cgi?id=4309. Apparently, locking isn't enabled by default. I just tried setting those environment variables, and when set the second user to open a file gets it in read-only mode. I'm CCing the openoffice list. Maybe these settings should be enabled by default? -- Alan Shutko [EMAIL PROTECTED] - In a variety of flavors! Your temporary financial embarrassment will be relieved in a surprising manner. -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]