Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!uunet!seismo!rutgers!cbmvax!daveh From: daveh@cbmvax.UUCP (Dave Haynie) Newsgroups: comp.sys.amiga Subject: Re: DeleteFile() problem Message-ID: <2163@cbmvax.UUCP> Date: Tue, 28-Jul-87 12:56:24 EDT Article-I.D.: cbmvax.2163 Posted: Tue Jul 28 12:56:24 1987 Date-Received: Thu, 30-Jul-87 00:44:58 EDT References: <02JRH437@TAMVENUS> Organization: Commodore Technology, West Chester, PA Lines: 29 in article <02JRH437@TAMVENUS>, JRH4373@TAMVENUS.BITNET says: > > [Go ahead...eat my line!] > Time for another question. I am experiencing a bit of difficulty with the > AmigaD*S function DeleteFile(). The documentation I have states that this > function will delete a file or directory. The problem is, in an application > I am writing, I am getting an object in use error when trying to delete any > directory after having deleted all files in that directory. The files all > delete fine, but when an attempt is then made to delete the directory, I get > the error. Keep in mind that this is a directory that my program has recently > created using mkdir() and no other processes are active. Sounds to me like your "mkdir()" function isn't releasing the FileLock that the DOS level CreateDir() function returns. As long as there's a FileLock still around on a file of any kind, DeleteFile() will refuse to delete it. If you can find this lock (prehaps your mkdir() returns it), UnLock() it and then try deleting the directory; you shouldn't have any trouble. If this doesn't work, maybe you should throw out the mkdir() function and go straight to the DOS CreateDir() call, since you're going to direct DOS calls anyway with DeleteFile(). > Anyone out there have any idea what I am doing wrong? > ****************************************************************************** > Joel << Hatchet >> Hall -- Dave Haynie Commodore-Amiga Usenet: {ihnp4|caip|rutgers}!cbmvax!daveh "The A2000 Guy" PLINK : D-DAVE H BIX : hazy "Catch a wave and you're sittin' on top of the world" -Beach Boys