delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp-workers/2001/01/19/10:16:58

Message-ID: <000701c0822a$bbe813c0$64eb79c3@internet>
From: "Robert van der Boon" <rjvdboon AT europe DOT com>
To: <djgpp-workers AT delorie DOT com>
References: <Pine DOT SUN DOT 3 DOT 91 DOT 1010109095357 DOT 19017B-100000 AT is> <000501c07c0e$9c67ab40$d7394bd5 AT robert> <7704-Sat13Jan2001115518+0200-eliz AT is DOT elta DOT co DOT il> <000501c07f34$cfdd7d00$1b354bd5 AT robert> <2593-Tue16Jan2001200825+0200-eliz AT is DOT elta DOT co DOT il>
Subject: Re: patch.exe (fwd)
Date: Fri, 19 Jan 2001 16:15:19 +0100
MIME-Version: 1.0
X-Priority: 3
X-MSMail-Priority: Normal
X-Mailer: Microsoft Outlook Express 5.50.4133.2400
X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4133.2400
Reply-To: djgpp-workers AT delorie DOT com

Eli wrote:
> So, what happens if you simply try to rename e:/djgpp/tmp/foo to
> e:/temp/bar with a simple call to _rename on that machine, and
> e:/temp/bar already exists?  Does it fail with the same error code
> 183?  And what happens if e:/temp/bar does not exist?
>
> (I'm trying to figure out whether there's a general problem with
> _rename on W2K, or maybe Patch does something that prevents _rename
> from working correctly.)

Testing shows that _rename gives an error when the targetfile already
exists.
I used the little program (TMPDIR points to e:/djgpp/tmp/, current dir is
e:\temp):
--- Code ---
#include <stdio.h>
#include <errno.h>
int main() {
  int i;
  _doserrno = 0; i= _rename("hoi.txt", "hoi1.txt");
  printf("ren: hoi.txt hoi1.txt -- %d, 0x%X\n", i, _doserrno);
  _doserrno = 0; i= _rename("hoi1.txt", "hoi2.txt");
  printf("ren: hoi1.txt hoi2.txt -- %d, 0x%X\n", i, _doserrno);
  _doserrno = 0; i=  _rename("hoi2.txt", "e:\\temp\\2\\hoi3.txt");
  printf("ren: hoi2.txt e:\\temp\\2\\hoi3.txt -- %d, 0x%X\n", i, _doserrno);
  _doserrno = 0; i= _rename("e:\\temp\\2\\hoi3.txt",
"e:\\temp\\2\\hoi4.txt");
  printf("ren: e:\\temp\\2\\hoi3.txt e:\\temp\\2\\hoi4.txt -- %d, 0x%X\n",
i, _doserrno);
  _doserrno = 0; i= _rename("e:\\temp\\2\\hoi4.txt", "hoi5.txt");
  printf("ren: e:\\temp\\2\\hoi4.txt hoi5.txt -- %d, 0x%X\n", i, _doserrno);
  return 0;
}
--- End Code ---
And it always fails (with -1) if the target already exists, or the source
doesn't exist. It always gives _doserrno=0xB7 if target exists, and 0x2 if
source doesn't exist.

> > I think I'll try using the NTLFN package as well, maybe it matters.
> This is not worth your effort: NTLFN replaces the LFN API with its own
> code, which is known to work, and we already established that this
> failure is somehow connected with W2K's LFN functions.

O, no, it IS worth the effort (although it doesn't help solving the problem,
I
admit that), because now I know there is a way to have my programs working
like they should. And all the effort was just a: lfnload & patch -i dif.dif.
Not so
much, if I may say so...

This is all the information one might need, I think.

Greetings,
 Robert

- Raw text -


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