delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp-workers/1996/10/06/07:59:29

Date: Sun, 6 Oct 1996 13:55:05 +0200 (IST)
From: Eli Zaretskii <eliz AT is DOT elta DOT co DOT il>
To: djgpp-workers AT delorie DOT com
Subject: Windows95 `rename' bug
Message-Id: <Pine.SUN.3.91.961006134751.2254B-100000@is>
Mime-Version: 1.0

There is a bug with rename/move file function on Windows95 that affects
mostly programs which backup files by renaming the old version to a
filename with a tilde at the end (e.g.  Emacs, GNU Fileutils).  If you
rename e.g. Makefile -> Makefile~, the long filename changes, but the
short 8+3 alias does not!  If, after that, you try to open Makefile and
write the new contents into it, your backup copy gets overwritten, and as 
far as long filenames are concerned, your ``new'' contents are now in 
Makefile~.

The solution is to rename via a temporary file, like so:

	Makefile -> temp_file -> Makefile~

This seems to be simple enough to be put into `_rename' in the library 
(conditioned on _USE_LFN), so that applications don't have to bother.  If 
nobody objects, I can submit the changes.

- Raw text -


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