Pismo wrote:
[...]
If I could lock a file with GPC (like flock in Perl) then I could create my own record locking implementation. Without being able to lock a file at the OS level trying to accomplish this would be flakey at best. I want to use GPC for multi-user database apps I'm porting from BP/Delphi.
If there is a C function for that you can use that:
extern void foobar ( int foo, char *bar );
becomes
Procedure Foobar ( foo: Integer; bar: CString ); C;
but you should better ask again at the GPC mailing list, gpc@hut.fi. I have no experience with Perl, sorry.
I don't use Perl or C, but I'm sure we must have a C programmer on the list who can answer this for us.
File and record locking is a service that should be provided by the operating system, not by a compiler. I believe that any modern operating system provides this facility - but this means that you might have to access the service in a different way under each operating system that you want to support (or write a single function to access the service, with zillions of #IFDEFs to cater for different operating systems). Since you are porting from Delphi, you might want to look at the LockFile, LockFileEx, UnLockFile, and UnLockFileEx API calls (the "...ex" APIs only work under NT, but the others work under NT, Win95, and Win32s).
BTW how would I check the system clock?
Look at the DOS and DOSH units in the BPCOMPAT package.
Best regards, The Chief -------- Dr. Abimbola A. Olowofoyeku (The African Chief) Email: laa12@keele.ac.uk Homepage: http://ourworld.compuserve.com/homepages/African_Chief/ Author of: Chief's Installer Pro 4.01 for Win16 and Win32: http://www.simtel.net/pub/simtelnet/win3/install/chief401.zip