To LUGNET HomepageTo LUGNET News HomepageTo LUGNET Guide Homepage
 Help on Searching
 
Post new message to lugnet.cad.devOpen lugnet.cad.dev in your NNTP NewsreaderTo LUGNET News Traffic PageSign In (Members)
 CAD / Development / 10561
10560  |  10562
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 you’re worried about users not liking that ~ crap in the files they see, that’s apparently required in Win 9x.


   So I think long file names still has the potential to cause problems. That is, if I’m not guilty of bad programming in this test.

You can’t control what filenames the user uses, so if you’re 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 ~ won’t be there unless you specifically put it there. In fact, the ~ versions of the files don’t 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:
  Re: Testing long filenames was Re: Unofficial directory (with non-standard name lenght)?
 
(...) 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: (URL) (Running on a Win98SE PC.) So I think long file names still has (...) (18 years ago, 2-Mar-07, to lugnet.cad.dev, FTX)

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
    

Custom Search

©2005 LUGNET. All rights reserved. - hosted by steinbruch.info GbR