Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:

Anyway to translate DOS files that have long filenames? My current names look like this on my NT:

Longna~1.ppt
Longnb~1.ppt
Nextfi~1.ppt
Nextfi~2.ppt
Filena~1.ppt

I want to get a list of all the filenames with their fullnames output to a text file.

Replies are listed 'Best First'.
Re: Long filenames in Windows NT
by PodMaster (Abbot) on Aug 20, 2002 at 11:22 UTC
Re: Long filenames in Windows NT
by theorbtwo (Prior) on Aug 20, 2002 at 10:57 UTC

    IIRC, NT doesn't have the concept of "long" and "short" names. Check on this with windows explorer -- right-click a file, and see if it gives you a long and short name.

    If it doesn't, what you're asking for is simply impossible. If it does, look at Win32::API, and search on Microsoft Developer Network for the proper API function to call. IIRC, there's a fairly simple API for this.


    Confession: It does an Immortal Body good.

Re: Long filenames in Windows NT
by JaWi (Hermit) on Aug 20, 2002 at 11:00 UTC
    You should check out the Win32API::File CPAN module. It allows you low-level access to the Win32 API related to file and directory handling.

    Succes!

    -- JaWi

    "A chicken is an egg's way of producing more eggs."