CDCKAB%EMUVM1.BITNET@cunyvm.cuny.edu ( Karl Brendel) (04/24/91)
I recently posted inquiring about ways to tell whether SHARE-compatible file sharing and locking were available. I'd like to summarize the responses I've had so far. First let me clarify belatedly that I am not interested in telling whether SHARE.EXE is present, but only whether file sharing and locking as provided by MS-DOS functions $3D and $5C are available. These services can be provided by software which does _not_ identify itself as SHARE.EXE. In my original posting, I mentioned the use of IOCTL subfunction $0B as a test for sharing/locking: this subfunction sets the retry count and delay interval for attempting to access a locked file. I mentioned that I knew no way to determine the current values of those parameters and thus was reluctant to change them without being able to restore them later. Now I find that that approach is not reliable, anyway, since it cannot distinguish the availability of sharing/locking under (at least) Compaq MS-DOS 3.31. Too bad that it isn't reliable, because Thomas E. Jenkins, Jr. (TOMJ@csdserver3.csd.scarolina.edu) gave me a pointer to the INTERxxx.ZIP files to determine the current values. ;( Richard Ward (microsoft!richardw@uunet.uu.net) and Tomas Holan (SOFTHW@CSPUNI12.BITNET) have pointed out the use of INT$2F to determine whether SHARE.EXE is loaded. Unfortunately, NetWare (and probably other network software) does not respond to this interrupt even though it provides sharing/locking. (Perhaps it does if some optional NetWare modules are loaded, but it doesn't as configured on my system.) (Unfortunately, also, my mailer can't handle Tomas Holan's address for some reason, so I've been unable to thank him directly for his help. Thanks, Tomas!) Unless a better solution turns up, my present approach is to open the file in interest, then attempt to lock an arbitrary record. The return from the lock call (function $5C) appears to tell reliably whether sharing/locking services are avaiable. My previously stated objection seems more esthetic than practical. I maintain the objection (to having to open the file before knowing if I can use it as required) but will live with the realities of the situation. ;) Thanks to all who thought about this matter. Cheers-- --Karl +====================================================================+ | Karl Brendel Centers for Disease Control | | Internet: CDCKAB@EMUVM1.BITNET Epidemiology Program Office | | Bitnet: CDCKAB@EMUVM1 Atlanta GA 30093 USA | | Home of Epi Info 5.0 | +====================================================================+