Re: Long File Names Support?

new topic     » goto parent     » topic index » view thread      » older message » newer message

At 17:26 27-07-97 -0400, Cameron Kaiser wrote:

>I have a directory with SomeLongFile.qrs, SomeLongerFile.qrs and
>SomeFileThatIsTheLongest.qrs. I know the naming scheme is usually
>SOMELO~?.QRS ... but how can I find out which one is SOMELO~1.QRS, etc.?
>
>I know Euphoria supposedly supports Win95 long filenames (correct me if I'm
>mistaken) ...  so what can I do to find out? Can someone write a function
>that can do this? If it supports wildcards, even better!


dos interrupt 21 function #71 and many sub function support translation for
long file
name to short file name  and other usefull thing like that.  Consult Ralph
Brown interrtupt list (best resource on the subject) for more information.

Here a function to translate from long file name to short one.


include machine.e

function LongNameToShortName(sequence lfn)
-- return dos 8.3 name of a long file name
sequence r, sfn
atom lfn_buffer, sfn_buffer
    lfn_buffer = allocate_low(length(lfn)+1)
    if not lfn_buffer then
        return -1
    end if
    poke(lfn_buffer,lfn&0)
    sfn_buffer = allocate_low(67)
    if not sfn_buffer then
        free_low(lfn_buffer)
        return -1
    end if
    mem_set(sfn_buffer,0,67)
    r = repeat(0,10)
    r[REG_AX] = #7160  -- function #71 sub function #60 long name to short name
    r[REG_CX] = 1
        r[REG_FLAGS] = 1
        r[REG_DS] = floor(lfn_buffer/16)
        r[REG_SI] = remainder(lfn_buffer,16)
        r[REG_ES] = floor(sfn_buffer/16)
        r[REG_DI] = remainder(sfn_buffer,16)
        r = dos_interrupt(#21,r)
        free_low(lfn_buffer)
        if and_bits(r[REG_FLAGS],1) then
                return -1
        end if
        sfn = peek({sfn_buffer,67})
        free_low(sfn_buffer)
        return sfn[1..find(0,sfn)-1]
end function

puts(1,LongNameToShortName("c:\\program files"))



Jacques Deschenes
Baie-Comeau, Quebec
Canada
desja at globetrotter.qc.ca

new topic     » goto parent     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu