delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp-workers/1999/06/15/03:05:41

Date: Tue, 15 Jun 1999 10:03:06 +0300 (IDT)
From: Eli Zaretskii <eliz AT is DOT elta DOT co DOT il>
X-Sender: eliz AT is
To: Alain Magloire <alainm AT rcsm DOT ece DOT mcgill DOT ca>
cc: djgpp-workers AT delorie DOT com
Subject: Re: Wrong errno value from rename() when sharing problems under Win9X
In-Reply-To: <199906150041.UAA10094@mccoy2.ECE.McGill.CA>
Message-ID: <Pine.SUN.3.91.990615100240.2646N-100000@is>
MIME-Version: 1.0
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

On Mon, 14 Jun 1999, Alain Magloire wrote:

> I thought, according to an old thread in this list, you could not
> do fd=open("file",..);unlink("file");read(fd,...);

That's not the problem that Andris was reporting.  His test program
worked as expected: the file was indeed NOT renamed, and the call to
`rename' failed.

The problem was that the `rename' function was setting incorrect value
in `errno': it should have been EACCES, but a bug in the library
caused it to be set to ENOENT, which is misleading.

(Actually, the bug was much more serious than just mis-setting
`errno': the code was trying to act as if the file was a directory,
and was attempting to move a directory tree rooted at that file...)

- Raw text -


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