www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp-workers/1998/07/22/04:28:16

Date: Wed, 22 Jul 1998 11:27:30 +0300 (IDT)
From: Eli Zaretskii <eliz AT is DOT elta DOT co DOT il>
To: George Foot <george DOT foot AT merton DOT oxford DOT ac DOT uk>
cc: djgpp-workers AT delorie DOT com
Subject: Re: Potential gotcha: Win98 vs. NameNumericTail
In-Reply-To: <199807220118.CAA02256@sable.ox.ac.uk>
Message-ID: <Pine.SUN.3.91.980722112702.10941S-100000@is>
MIME-Version: 1.0

On Wed, 22 Jul 1998, George Foot wrote:

> In Windows 95 you can achieve the same effect as temporarily turning
> off the numeric tails before creating a file with a long name by
> doing two renames on the file -- first renaming it to its truncated
> short name (e.g. rename libstdcxx.a to libstdcx.a) and then renaming
> that back to the long name again (rename libstdcx.a to libstdcxx.a)
> -- using the DOS `ren' command.  The first renaming corrects the
> short name, and the second does not affect the short name at all --
> it just changes the long name.  So you end up with a filename that
> works whether or not LFN is enabled.

Don't use this method and don't rely on it: it's a bug in Windows 95
that this at all works.  It's the same bug that's responsible for the
fact that "ren foobar foobar~" leaves the short alias unchanged for
certain file names.

> This doesn't work under
> Windows 98 though -- the short name is mangled again by the second
> rename.

So they've finally fixed it...

> Unfortunately djgpp's
> `rename' and `_rename' functions seem to have the same problem that
> the Windows 98 `ren' command has.

That's because DJGPP's `_rename' works around the Windows 95 bug, to
prevent a program that backs up files by renaming from overwriting the
backup.  It is all documented in the library sources.

> It's still possible (but crude) to
> make the program output a batch file, which would work under Windows
> 95 (but not under Windows 98).  The program would require LFN support
> to be enabled while it runs.

I don't understand which problem are you trying to solve this way.  If
you want to disable numeric tails, just do it.  As I said in another
mail, most DJGPP users don't (and shouldn't) care about the tails, so
it's largely a non-issue (IMHO).

- Raw text -


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