$include (..\lib\compStch.ext) /* *============================================================================ * This program is distributed in the hope that it will be useful, but * WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE * * Permission to use for any purpose, modify, copy, and make enhancements * and derivative works of the software is granted if attribution is given to * R.M. Gillmore, dba the ACME Software Deli, as the author * * While the ACME Software Deli does not work for money, there is nonetheless * a significant amount of work involved. The ACME Software Deli maintains the * rights to all code written, though it may be used and distributed as long as * the following conditions are maintained. * * 1. The copyright statement at the top of each code block is maintained in * your distribution. * 2. You do not identify yourself as the ACME Software Deli * 3. Any changes made to the software are sent to the ACME Software Deli *============================================================================ */ longFileNameModule: do; $if not noID declare IDString (*) byte data ( '@(#)lfModule.p86 $Author: rmgillmore $ $Date:: 2025-05-04 19:35:39#$:', 0 ); $endif $set ( lfnModule ) $include (..\lib\sysCalls.ext) $include (..\lib\fileIO.ext) declare longNamesSupported byte, checkPerformed byte; lfnSupported: procedure boolean reentrant public; declare cpuRegisters, rootDriveSpecString (*) byte data ( 'C:\', 0 ), volumeNameString (32) byte, isSupported boolean; if ( checkPerformed ) then isSupported = longNamesSupported; else do; /* * to discover whether long file name functions are supported, attempt to * retrieve the volume information. If 0 is returned in the AL register, * long file names are not supported. * * So, why are we using the "retrieve volume information" function? */ wordRegs.Ax = 71a0h; wordRegs.Ds = selector$of( @rootDriveSpecString ); wordRegs.Dx = offset$of( @rootDriveSpecString ); wordRegs.Es = selector$of( @volumeNameString ); wordRegs.Di = offset$of( @volumeNameString ); wordRegs.Cx = size( volumeNameString ); call int86( DOS_CALL, @wordRegs ); if ( carryClear( @wordRegs ) and ( wordRegs.Ax = 71a0h ) ) then isSupported = True; else isSupported = False; longNamesSupported = isSupported; checkPerformed = True; end; return ( isSupported ); end lfnSupported; end longFileNameModule;