dos_compilers/DX-FORTH v430/LFN.SCR
2024-07-09 09:07:02 -07:00

1 line
6.0 KiB
Plaintext

\ Long filename support Long filename support for Windows95+ \ Long filename support forth definitions decimal application blk @ 1+ #screens 1- thru \ Long filename support \ Return true if DOS version 7 or greater : dos7 ( -- flag ) dosver nip 6 > ; \ Return error code : lfnerr ( -- ior ) 'AX @ $7100 - if doserr? else $FEFF then ; \ buffer for asciiz strings create zbuf 260 2 + allot \ CREATE-FILE OPEN-FILE \ open/create long filename : lopen ( c-addr u fam mode -- fid ior ) 'DX ! 'BX ! zbuf zplace zbuf 'SI ! 0 'CX ! 0 'DI ! $6C 'AX c! $71 doscall 'AX @ lfnerr ; -? : CREATE-FILE ( c-addr u fam -- fid ior ) dos7 if $12 lopen else create-file then ; -? : OPEN-FILE ( c-addr u fam -- fid ior ) dos7 if $01 lopen else open-file then ; \ DELETE-FILE \ delete long filename -? : DELETE-FILE ( c-addr u -- ior ) dos7 if zbuf zplace zbuf 'DX ! 0 'CX ! 0 'SI ! $41 'AX c! $71 doscall lfnerr else delete-file then ; behead dos7 lopen