1. Long and short filename by DIR

Using the standard routine DIR, after  x = DIR(st)
 in DOS32 :  x[1] is a standard DOS 8.3 name
 in WIN32 :  x[1] is a long file name

I need both name in my programs. How can I get them in WIN32?

Suggestion: DIR should return a 10th entry  and
x[10] should always be the standard DOS 8.3 (in WIN32 and in DOS32).
Almost all the old programs should run without modification
since they don't use x[10].

What is your answer to my question
and your opinion to my suggestion?

new topic     » topic index » view message » categorize

2. Re: Long and short filename by DIR

----- Original Message ----- 
From: "Gilbert Lemaitre" <lemaitre at adfi.ucl.ac.be>
> 
> Using the standard routine DIR, after  x = DIR(st)
>  in DOS32 :  x[1] is a standard DOS 8.3 name
>  in WIN32 :  x[1] is a long file name
> 
> I need both name in my programs. How can I get them in WIN32?
> 
> Suggestion: DIR should return a 10th entry  and
> x[10] should always be the standard DOS 8.3 (in WIN32 and in DOS32).
> Almost all the old programs should run without modification
> since they don't use x[10].
> 
> What is your answer to my question
> and your opinion to my suggestion?

Hello Gilbert,

if this is important that 8.3 names are retrieved, I have a alternative to
Euphoria's Dir( ) on the user-contrib page.

using FindFirstFile or FindNextFile the WIN32_FIND_DATA structure
at cAlternateFileName will contain the 8.3 name format.

a NULL terminated string will be returned by the given handle to the file.

In my Alt-Dir( ) program you could try this...

look for a line that looks like this >
else pdirs = append(pdirs, {peek_zstring(FindData + FindData_cFileName)}& {pa})
and replace this code > peek_zstring(FindData + FindData_cFileName) with 
this code > peek_zstring(FindData + FindData_cAlternateFileName)

If you need help with this (cause my code *is a bit messy), let me know.
Dir2( ) isnt as fast as the built-in Euphoria dir( ) but can be modified to suit
your needs.
Eu's dir( ) doesnt have this luxury.
I may one day attempt to speedup the function, maybe.
right now though, it is pretty fast.

Euman
euman at bellsouth.net

new topic     » goto parent     » topic index » view message » categorize

Search



Quick Links

User menu

Not signed in.

Misc Menu