Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!uupsi!cmcl2!adm!news From: CDCKAB%EMUVM1.BITNET@cunyvm.cuny.edu ( Karl Brendel) Newsgroups: comp.lang.pascal Subject: testing for sharing/locking ability Message-ID: <26583@adm.brl.mil> Date: 17 Apr 91 17:37:14 GMT Sender: news@adm.brl.mil Lines: 35 I'm looking for straightforward, "foolproof" ways to tell whether MS-DOS file sharing and locking (compatible with SHARE.EXE) is available on a given drive. I've found two ways to make this determination, and I'm not completely happy with either of them: 1) Go ahead and open the file, then try to lock it (function $5C). If sharing/locking is not available, function $5C returns its error 1 (invalid function code). 2) Call IOCTL (function $44) subfunction $0B to set the sharing retry count. If sharing is not available, it returns error 1. I'm not happy with 1) because it requires me to open the file before I know whether I can share/protect it appropriately. I'd be happy with 2) if I knew a reliable, documented way to determine the existing value of the parameter I was changing. (On principle I'd want to restore the existing sharing retry count.) Can someone here provide me a better method (or a pointer to one) for determining the availability of sharing/locking, and/or a way to get the existing value of the sharing retry count? Thanks in advance-- --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 | +====================================================================+