Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!uflorida!gatech!dcatla!holos0!lbr From: lbr@holos0.UUCP (Len Reed) Newsgroups: comp.sys.ibm.pc Subject: Disk I/O in Resident MS-DOS Program Message-ID: <1872@holos0.UUCP> Date: 16 Feb 89 16:40:45 GMT Reply-To: lbr@holos0.UUCP (Len Reed) Distribution: usa Organization: Holos Software, Atlanta Lines: 30 I have an MS-DOS terminate-and-stay resident program that must be able to open/close/read/write hard disk files. It appears that the "file handles" move on me. That is, if this routine opens a file, as the foreground processes spawn and die, I lose my handles since they really belong to the foreground processes. FCB I/O appears to work better, but I'm not crazy about using it since it is primitive. My opens and closes have to be in the current directory, which means I have to perform the following to do an open or close: 1. Lock the foreground out of DOS. (I have a mechanism in place to stall DOS calls.) 2. Save the current directory. (MS-DOS has one directory per disk, not--as in UNIX--one per process.) 3. Go to the proper directory. 4. Perform the open/close. 5. Go back to the original directory. 6. Unlock DOS. This scenerio seems unnecessary for read/writes. I can do them regardless of my current directory. Is there a better way to do this? What I'm doing seems to work; am I missing something that will cause it not to work? BTW--the application is a communications package that sits in the background and steals time to transfer/receive files to/from a mainframe. Thanks for any help. -- - Len Reed