Board index » delphi » Long Filename to Short Filename

Long Filename to Short Filename

How can I find out the short filename version of a long filename ?

Im using Windows 95 and Delphi 2.0 and need to convert a file which
has a list of filenames in long filename format to short filenames.

I have seen a function somewhere to do this but can no longer find it.
Wasnt in the Delphi Q+A at the Inprise site.

Barry

 

Re:Long Filename to Short Filename


It's an API function :- "GetShortPathName"
Quote
R. Barry Jones wrote:
> How can I find out the short filename version of a long filename ?

> Im using Windows 95 and Delphi 2.0 and need to convert a file which
> has a list of filenames in long filename format to short filenames.

> I have seen a function somewhere to do this but can no longer find it.
> Wasnt in the Delphi Q+A at the Inprise site.

> Barry

Re:Long Filename to Short Filename


Barry,

See the Win32 API help file topic GetShortPathName().

Ken
---
Ken White
kwh...@westelcom.com

Clipper Functions for Delphi
http://members.aol.com/clipfunc

Quote
R. Barry Jones wrote:

> How can I find out the short filename version of a long filename ?

> Im using Windows 95 and Delphi 2.0 and need to convert a file which
> has a list of filenames in long filename format to short filenames.

> I have seen a function somewhere to do this but can no longer find it.
> Wasnt in the Delphi Q+A at the Inprise site.

> Barry

--

Re:Long Filename to Short Filename


  There is a standard Win32 API called GetShortPathname. I don't know if
it's in D2, but D4 does have a built-in 'wrapper' named
ExtractShortPathName. (Shortname:=ExtractShortPathName(LongName);)

Quote
R. Barry Jones wrote:
> How can I find out the short filename version of a long filename ?

> Im using Windows 95 and Delphi 2.0 and need to convert a file which
> has a list of filenames in long filename format to short filenames.

> I have seen a function somewhere to do this but can no longer find it.
> Wasnt in the Delphi Q+A at the Inprise site.

> Barry

--
If there is a no_junk in my address, please REMOVE it before replying!
All junk mail senders will be prosecuted to the fullest extent of the
law!!
http://www.ntsource.com/~andyross

Other Threads