delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1997/05/08/13:10:25

Date: Thu, 8 May 1997 20:09:36 +0300 (IDT)
From: Eli Zaretskii <eliz AT is DOT elta DOT co DOT il>
To: Paul Campisi <pcampisi AT ececs DOT uc DOT edu>
cc: djgpp AT delorie DOT com
Subject: Re: Exclusive access to drive
In-Reply-To: <199705081540.LAA01261@banana.ece.uc.edu>
Message-ID: <Pine.SUN.3.91.970508200242.21561B@is>
MIME-Version: 1.0

On Thu, 8 May 1997, Paul Campisi wrote:

> system("chkdsk");
> it gives me something like - CORRUPTED FAT TABLE
> 
> system("chkdsk /f");
> it gives me "unable to get exclusive access to drive x" (where x is
> the drive I am using chkdsk on)

I think the reason is that CWSDPMI opens a swap file to support virtual
memory, and CHKDSK complains because the directory entry for the swap file
isn't updated until you exit your program (at which point CWSDPMI closes
and deletes the swap file). 

It is generally not recommended to run CHKDSK while another program has 
some files open.  If you try that from Windows' DOS box, for example, you 
will also see error messages from CHKDSK.

> or is there any other way to run the chkdsk command?

You didn't explain why do you need to run CHKDSK in the middle of your 
program.  So it's hard to answer this question.

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019