Mail Archives: djgpp/2000/02/25/14:14:33
Hans-Bernhard Broeker wrote:
> Mariano Alvarez Fernández <malfer AT teleline DOT es> wrote:
> > Hello, do somebody know how to get/set the short file name in w9x when
> > you are using LFN's?
>
> In a nutshell: you *don't*. Short filenames are automatically
> generated by the system, and you're not given any influence over that
> process, except that you can disable *all* short file names gettting
> that pesky '~1' tail, even if they don't need them (see the
> 'NameNumericTails' trick). This is a rather severe design flaw in
> Windows' long filename implementation, IMHO. It causes all kinds of
> weird behaviour, inside Windows itself, too.
The 'NameNumericTail' trick can cause some problems though. Here's an
example of why I turned NNT back on:
Make 2 files, on named "a.cpp" and another named "a.cpp~" (I was using emacs
when I discovered this), the SFN's for these files will likely be "a.cpp" and
"a~1.cpp". Now try copying both files to another directory. There is a 50%
chance that one of the files will dissapear!
What happens is that if the "a.cpp~" file is copied first, it will have a
short-filename of "a.cpp", and then when the other file is copied, DOS decides
to overwrite "a.cpp~" with "a.cpp" because they have the same SFN.
--
(\/) Rolf Campbell (\/)
- Raw text -