Subject:
|
Re: Testing long filenames was Re: Unofficial directory (with non-standard name lenght)?
|
Newsgroups:
|
lugnet.cad.dev
|
Date:
|
Fri, 2 Mar 2007 20:22:34 GMT
|
Viewed:
|
4799 times
|
| |
| |
In lugnet.cad.dev, Tore Eriksson wrote:
|
Well, I made a small program in Delphi 7 that lists the command line
parameters, drag and dropped a file named LongFileName.dat in it, and here
is the surprising result: http://web.telia.com/~u66203131/pix/ShowParms.jpg
(Running on a Win98SE PC.)
|
My best guess is at that time MS was trying to make things safe for old programs
(although it seems senseless for them to have done this with Win32 apps). If
you call the Win32 function GetLongPathName on the short path, it will give you
the long path. If youre worried about users not liking that ~ crap in the
files they see, thats apparently required in Win 9x.
|
So I think long file names still has the potential to cause problems. That
is, if Im not guilty of bad programming in this test.
|
You cant control what filenames the user uses, so if youre dealing with user
files that might be specified from Explorer on the command line, you have to
call GetLongPathName to guarantee that the ~ crap is gone. However, if you
access a file in your program with a long filename, the ~ wont be there unless
you specifically put it there. In fact, the ~ versions of the files dont show
up in directory listings when you use FindFirstFile and FindNextFile to scan a
directory in your code.
--Travis
|
|
Message has 1 Reply: | | I hereby accect long file names!
|
| (...) It's an utterly complicated way, but it works! Only problem is that GetLongPathName erases all other kinds of command line parameters. Now that I know that at least it is possible to avoid shortened pathnames, I rest my case. I no longer (...) (18 years ago, 2-Mar-07, to lugnet.cad.dev, FTX)
|
Message is in Reply To:
39 Messages in This Thread:
- Entire Thread on One Page:
- Nested:
All | Brief | Compact | Dots
Linear:
All | Brief | Compact
This Message and its Replies on One Page:
- Nested:
All | Brief | Compact | Dots
Linear:
All | Brief | Compact
|
|
|
|