From: john AT exmachina DOT net (John Mullee) Subject: Re: B20, Win95: cp destroys file 17 Nov 1998 03:08:16 -0800 Message-ID: <3.0.3.16.19981116202503.26d7264c.cygnus.gnu-win32@exmachina.net> References: <9811160532 DOT AA24319 AT modi DOT xraylith DOT wisc DOT edu> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" To: khan AT xraylith DOT wisc DOT edu, earnie_boyd AT yahoo DOT com, hank AT watson DOT ibm DOT com, noer AT cygnus DOT com Cc: gnu-win32 AT cygnus DOT com At 23:32 1998-11-15 -0600, you wrote: >Earnie Boyd writes: >> ---"Henry S. Warren, Jr." 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 AT cygnus DOT com" with one line of text: "help".