| TIP: Click on subject to list as thread! | ANSI |
| echo: | |
|---|---|
| to: | |
| from: | |
| date: | |
| subject: | [fwd] Re: locking() |
andrew, Not so long ago (20 Nov 02) you wrote to me: >> Here's the code which is working in GoldED+: >> if(LockFile((HANDLE)_get_osfhandle(fh), offs, 0L, len, 0L)) >> return 0; ac> Ahh! I knew I'd get an answer eventually. ;-) Thank you! You're welcome :) ac> But how did you know to use _get_osfhandle()? (Or did someone else ac> write that?) I found this function in MSDN, it converts "libc" handle into the Win32 HANDLE. I think I had the same problem before I wrote that code, though not sure. It was about 2 years ago. ac> Incidentally, _locking(_get_osfhandle(fd), LK_LOCK, 1) still fails, so ac> I still don't know what sort of value it's expecting for the file ac> handle. I'd look at the MingW32 C runtime library source, but I can't ac> find it, and www.mingw.org is down, but never mind all that, I don't ac> need to get _locking() to work any more! I have compiled and run your code and it works just like in Borland. So, the only idea why it doesn't work for you is that your cygwin use crtdll version of MinGW rather than msvcrtl. crtdll is very buggy. At least there are bugs with the stat function which returns the times with one hour difference for the different DST (i.e. at winter you get incorrect time for the summer files and vice-versa), and with localtime - it is always switch DST accordingly to the US standard regardless of Control Panel settings. WBR, Alexander --- GoldED+ snapshot-2002.10.27 (WinNT 5.1.2600-Service_Pack_1 i686)* Origin: Fraggle's Nest, Riga, Latvia (2:203/614.103) SEEN-BY: 10/3 345 102/943 106/1 2 3 1234 2000 123/500 128/187 130/803 140/1 SEEN-BY: 143/2 201/505 226/600 229/1000 2000 3000 249/116 267/200 280/5003 SEEN-BY: 333/0 379/1 1200 633/267 270 2404/201 2624/306 3800/1 @PATH: 203/600 20/11 2411/413 2432/200 2476/418 140/1 106/2000 1 379/1 633/267 |
|
| SOURCE: echomail via fidonet.ozzmosis.com | |
Email questions or comments to sysop@ipingthereforeiam.com
All parts of this website painstakingly hand-crafted in the U.S.A.!
IPTIA BBS/MUD/Terminal/Game Server List, © 2025 IPTIA Consulting™.