Subject: Re: B20, Win95: cp destroys file
From: [email-masked] (John Mullee)

17 Nov 1998 03:08:16 -0800
Message-ID: <[email-masked]>
References: <[email-masked]>
Mime-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
To: [email-masked], [email-masked], [email-masked],
        [email-masked]
Cc: [email-masked]

At 23:32 1998-11-15 -0600, you wrote:
>Earnie Boyd <[email-masked]> writes:
>> ---"Henry S. Warren, Jr." <[email-masked]> wrote:
>> Hmm.  It used to do it that way in b19.  Is it possible that inode or
>> stat routine has become buggy?
>I believe that the problem is in MoveFileEx (WIN API), which doesn't do ..
>turn uses MoveFileEx to do the actual renaming).

The 1996-02-20 (VC4.1) MSVCRT.DLL (95&NT) uses MoveFile, like this:

(vc4.1/crt/src/rename.c; paraphrased for legal reasons (& clarity))

int __cdecl rename(const char *filename_from, const char *filename_to)
  {
   if(!MoveFile(filename_from, filename_to))
     {
      /* this error mapping is just for 'dos compatability' (!) /*
      _dosmaperr(GetLastError());
      return -1;
     }
   return 0;
  }

The same file contains a bogload of hocus-pocus to
reproduce the effect on a Mac. Eek.

-------------------

int MoveFile(const char *filename_from, const char *filename_to) -

The MoveFile function will move (rename) either a file or a directory
(including all its children) either in the same directory or across
directories. The one caveat is that the MoveFile function will fail on
directory moves when the destination is on a different volume. 

filename_from
  Points to a null-terminated string that names an
  existing file or directory.
filename_to
  Points to a null-terminated string that specifies the
  new name of a file or directory. The new name must not already exist.
  A new file may be on a different file system or drive.
  A new directory must be on the same drive. 

HTH;

John.

-
For help on using this list (especially unsubscribing), send a message to
"[email-masked]" with one line of text: "help".