www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp-workers/1999/06/14/09:24:31

From: pavenis AT lanet DOT lv
Message-ID: <B0000090438@stargate.astr.lu.lv>
To: djgpp-workers AT delorie DOT com
Date: Mon, 14 Jun 1999 16:24:03 +0300
MIME-Version: 1.0
Subject: Wrong errno value from rename() when sharing problems under Win9X
X-mailer: Pegasus Mail for Win32 (v3.11)
Reply-To: djgpp-workers AT delorie DOT com

--Message-Boundary-14463
Content-type: text/plain; charset=US-ASCII
Content-transfer-encoding: 7BIT
Content-description: Mail message body

Hi!

Rename returns invalid value in errno under Win95 when attempting 
to rename already opened file (I got ENOENT, should be
EACCES). Test example included in attachment.
I used libc.a from CVS version (updated in June 12th) compiled
with gcc-2.95 19990608 (prerelease)

Andris



--Message-Boundary-14463
Content-type: text/plain; charset=US-ASCII
Content-disposition: inline
Content-description: Attachment information.

The following section of this message contains a file attachment
prepared for transmission using the Internet MIME message format.
If you are using Pegasus Mail, or any another MIME-compliant system,
you should be able to save it or view it from within your mailer.
If you cannot, please ask your system administrator for assistance.

   ---- File information -----------
     File:  ren_test.cc
     Date:  14 Jun 1999, 16:17
     Size:  406 bytes.
     Type:  Text

--Message-Boundary-14463
Content-type: Application/Octet-stream; name="ren_test.cc"; type=Text
Content-disposition: attachment; filename="ren_test.cc"

#include <stdio.h>
#include <errno.h>
#include <fstream>

void mkTestFile (void)
  {
      ofstream output ("test.dat");
      output << "test.dat";
  }

int main (void)
  {
      mkTestFile ();
      FILE * test = fopen ("test.dat","r");
      int rc = rename ("test.dat","foo.dat");
      if (rc) perror ("rename(\"test.dat\",\"foo.dat\")");
      fclose (test);
      return 0;
  }


--Message-Boundary-14463--

- Raw text -


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