Hello DG, On Fri, 14 Mar 2003 12:27:18 -0500 GMT (15/03/03, 00:27 +0700 GMT), DG Raftery Sr. wrote:
TF>> Want to talk with me about semaphores and how file TF>> locking works? Or what physically happens when a file on a network TF>> drive is accessed for writing by two users at the same time and why TF>> this *will* (not *could*) cause data corruption? > It shouldn't. Once the file is locked it should, under proper programming, > be locked to a write function. It should remain open to a read call but > past that I cannot fathom a data corruption in this instance. Yeah, well. TB does not lock the file at all. > If the programmer of the application properly coded the program and the > first user opened the file to write function, and created the lock call, > this would force the handle closed to write therefore causing user two > no access. That's what I am saying. TB just doesn't lock the file. Two users can access the file for writing at the same time. > In some instances this could happen if the write calls were exactly > simultaneous but that has a probability of about a million to one. Sure. But it happened. Therefore, I am all for locking the file, at least during write access. As I said, I even lock files during read access, even though that may be an overkill. I see no reason not to lock the files. Automatically updating every user who only reads the file costs time, this is where I agree with Pit. > Anyway ... I agree with this, too <g>. Let's lock the file "anyway", once because it doesn't cost much CPU time, and once because it avoids any "possible" problems - and it is good programming practice, too. IMHO. You know Murphy. -- Cheers, Thomas. Moderator der deutschen The Bat! Beginner Liste. Exaggeration is a billion times worse than understatement. Message reply created with The Bat! 1.63 Beta/5 under Chinese Windows 98 4.10 Build 2222 A using an AMD Athlon K7 1.2GHz, 128MB RAM ________________________________________________ Current version is 1.62 | "Using TBUDL" information: http://www.silverstones.com/thebat/TBUDLInfo.html

