delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2000/11/01/17:00:09

Date: Wed, 01 Nov 2000 22:43:04 +0200
From: "Eli Zaretskii" <eliz AT is DOT elta DOT co DOT il>
Sender: halo1 AT zahav DOT net DOT il
To: djgpp AT delorie DOT com
Message-Id: <3405-Wed01Nov2000224304+0200-eliz@is.elta.co.il>
X-Mailer: Emacs 20.6 (via feedmail 8.3.emacs20_6 I) and Blat ver 1.8.5h
In-reply-to: <9ZXL5.1281$Mf4.211263@news.shore.net> (message from Mark T on
Wed, 01 Nov 2000 16:58:45 GMT)
Subject: Re: Directory "sync"?
References: <9ZXL5.1281$Mf4 DOT 211263 AT news DOT shore DOT net>
Reply-To: djgpp AT delorie DOT com
Errors-To: nobody AT delorie DOT com
X-Mailing-List: djgpp AT delorie DOT com
X-Unsubscribes-To: listserv AT delorie DOT com

> From: Mark T <marktnospam AT shore DOT net>
> Newsgroups: comp.os.msdos.programmer,comp.os.msdos.djgpp
> Date: Wed, 01 Nov 2000 16:58:45 GMT
> 
> Int21 - AH=0dh:
> "This function writes all modified disk buffers to 
> disk, but does not update the directory information 
> (that is only done when files are closed or a 
> SYNC call is issued)"
> 
> What SYNC call?

You can ask _that_ again.

Where did you see this description?  DOS doesn't have any SYNC system
call.

> I found one under djgpp and tried it, but it didn't seem to do what
> I need.

If you mean the library function `sync', then it resets the disk on
plain DOS, and flushes the disk cache buffers on Windows 9X.

If you want file's data to be delivered to the disk, you need to call
`fflush' on the FILE stream where you have the file open.  Do that
*before* you call `sync'.

> Is there another sync I can't find?

What exactly is the problem?  Doesn't `fflush' followed by a `sync'
cause the file to appear on the disk?

> Do I need to open a bogus file and close it to refresh the directory
> listing?

Don't you already have the file open?  If not, how exactly did you
``add'' it?

The call to `fflush' and `fsync'/`sync' does the same as `close', as
far as delivering the file's data to the disk is concerned.

- Raw text -


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