www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp-workers/1999/04/08/11:55:03

Date: Thu, 8 Apr 1999 11:55:00 -0400
Message-Id: <199904081555.LAA13248@envy.delorie.com>
From: DJ Delorie <dj AT delorie DOT com>
To: eliz AT is DOT elta DOT co DOT il
CC: djgpp-workers AT delorie DOT com
In-reply-to: <Pine.SUN.3.91.990408112409.29868N-100000@is> (message from Eli
Zaretskii on Thu, 8 Apr 1999 11:24:30 +0200 (IST))
Subject: Re: fflush question
References: <Pine DOT SUN DOT 3 DOT 91 DOT 990408112409 DOT 29868N-100000 AT is>
Reply-To: djgpp-workers AT delorie DOT com
X-Mailing-List: djgpp-workers AT delorie DOT com
X-Unsubscribes-To: listserv AT delorie DOT com

> I agree, provided that many/most Unix systems indeed behave that way.
> Could people please test this on the systems they have access to?

Linux doesn't need fsync().  This works as expected:

#include <stdio.h>

main()
{
  FILE *a, *b;
  int i;

  a = fopen("foo1", "w");
  fprintf(a, "123456");
  fflush(a);

  b = fopen("foo1", "r");
  fscanf(b, "%d", &i);
  printf("i=%d\n");
}

- Raw text -


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