Mail Archives: djgpp-workers/1998/07/22/04:28:16
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 -