Message-Id: <199807220118.CAA02256@sable.ox.ac.uk> Comments: Authenticated sender is From: George Foot To: djgpp-workers AT delorie DOT com Date: Wed, 22 Jul 1998 02:17:16 +0000 MIME-Version: 1.0 Content-type: text/plain; charset=US-ASCII Content-transfer-encoding: 7BIT Subject: Re: Potential gotcha: Win98 vs. NameNumericTail Reply-to: george DOT foot AT merton DOT oxford DOT ac DOT uk Precedence: bulk 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. This doesn't work under Windows 98 though -- the short name is mangled again by the second rename. I think supplying a utility to do this for people would be safer than encouraging them to adapt their registries. Unfortunately djgpp's `rename' and `_rename' functions seem to have the same problem that the Windows 98 `ren' command has. 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. An alternative solution would be for maintainers of packages that now use long filenames to include a batch file to rename the files suitably. All this would still only work under Windows 95; to make something that would also work under Windows 98 I don't think you could avoid altering the registry. A utility could be made to work under both '95 and '98, by temporarily altering the registry setting -- read the current setting, then turn off the numeric tails before doing the renames, then restore the original setting. I think Richard Dawe has working registry reading code for djgpp (which works through a standard VxD), so it would be possible to write this utility using djgpp. -- george DOT foot AT merton DOT oxford DOT ac DOT uk