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

From: Mark Tsombakos <markt AT shore DOT net>
Subject: Re: Directory "sync"?
Newsgroups: comp.os.msdos.djgpp
References: <9ZXL5.1281$Mf4 DOT 211263 AT news DOT shore DOT net> <3405-Wed01Nov2000224304+0200-eliz AT is DOT elta DOT co DOT il>
Organization: Shore.Net; a Primus Company
User-Agent: tin/1.4.4-20000803 ("Vet for the Insane") (UNIX) (SunOS/5.5.1 (sun4u))
Lines: 67
Message-ID: <Pl1M5.1319$Mf4.215738@news.shore.net>
Date: Wed, 01 Nov 2000 23:06:23 GMT
NNTP-Posting-Host: 207.244.124.103
X-Complaints-To: abuse AT shore DOT net
X-Trace: news.shore.net 973119983 207.244.124.103 (Wed, 01 Nov 2000 18:06:23 EST)
NNTP-Posting-Date: Wed, 01 Nov 2000 18:06:23 EST
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp
Reply-To: djgpp AT delorie DOT com

Thanks for the quick response, Eli!

>> 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.

Ok.  What SYNC call :)

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

I found it on every web page describing DOS interrupt and resetting the
disk.  For example:

http://moon.act.uji.es/docs/interr/21/0D.HTM

>> 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.

Ahh.  Didn't know that the cache flush was win 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?

The problem is, I'm not creating a file in my application.  As I
mentioned, I'm sharing a scsi disk between two pc's under msdos.
If I create/modify/delete a file on one pc, I want to see that change
on the other (again, under DOS only).  I thought the "share.exe"
application was the answer, but it didn't seem to completely fix
the problem (sometimes the file(s) showed up, sometimes not)

Interestingly, and what lead me to write my own
"refresh" or "flush" app was that if I run share.exe, whether or
not it's loaded already, changes made on one pc show up on the other
(where I ran share).  I suspected that share.exe was doing some kind
of directory refresh before it decided it was already loaded and 
quitting.  It is that "refresh" mechanism I am trying to recreate.

>> 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?

Either by copying it, or "echo > test".


Thanks again for your insight.

Mark

- Raw text -


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