This is the mail archive of the cygwin@sourceware.cygnus.com mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: B20, Win95: cp destroys file


At 23:32 1998-11-15 -0600, you wrote:
>Earnie Boyd <earnie_boyd@yahoo.com> writes:
>> ---"Henry S. Warren, Jr." <hank@watson.ibm.com> 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
"gnu-win32-request@cygnus.com" with one line of text: "help".


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]