I take a somewhat different approach. The app that is run is simply a loader, it might go unchanged for years. It loads, looks around to find the version it's supposed to run and runs that. The real program is stored with a numeric extension rather than a .EXE, the loader simply finds the...
I wouldn't leave the locking until last--that just about guarantees you will have problems. When dealing with a multi-user situation you must keep locks on your mind as you are writing it.
Hebbe's code is fine if you're using Turbo Pascal. I can definitely confirm it works on a Novell server, it should work on any server. However, my experience is that it does *NOT* work in a dos box of XP Pro.
Don't give up on the locks--multi-user programs are *NOT* reliable without...
While the basics of your solution would work (no need to wait, just leave the file open. In fact there's no need to write anything.) it's horribly inefficient and it's just using the system's own locking facilities in another fashion.
Quit trying to dodge the manual, lock it correctly...
You *CAN'T* implement your own locks that way--locking must be an atomic operation and check-if-clear-and-write-true is not atomic.
While it's possible to do some of your own locking (if you wish to deny specific operations but permit others) at the heart of it you *MUST* use the...
>its just sharing files. I dont need messaging or anything, i >just need a database to be updateable on one comp and then >viewable on another.
>Though I would like it to be maintainable so I guess the >messaging would be somthing Id have to look at in depth.
If all you need is file...
No. In protected mode you can't absolute to a memory location, period--the only legal use of absolute is to put two variables on top of each other. You must build a pointer to it instead.
Instead of storing IOResult, simply read InOutRes instead. Same thing but it doesn't get wiped. Note that this will *NOT* work in Delphi, though. However, you don't really need $I- in Delphi, exceptions are so much better.
As for error logs--you need to at least flush and commit (note...
$I has nothing to do with system interrupts. It has to do with I/O error checking. Turned on, I/O errors bomb the program. Turned off they are merely returned in IOResult.
So long as you stay in real mode, SegB800 and $B800 are the same thing. However, in protected mode, $B800 is a runtime error. I much prefer to work in protected mode.
Borland has not released any patch for the runtime 200 problem in the CRT unit--support was long since dropped before it came to light (it takes a PII-200 or better to expose it). You'll have to get a third-party fix for it.
7.1 still has the CRT bug. It wasn't discovered until long after they quit dealing with the dos versions. Note that it's a lot easier to patch the offending code in the CRT unit than to replace the whole thing.
I'm puzzled by why your original didn't work, though. Other than the upcase...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.