10-25-2003, 08:34 PM
Hi.
&H27 (change long filename to short filename) works fine, but &H10 (and the rest, too) does not work. I need to change the long directory to short before I change the long filename to short filename, but it isn't happening.
Any ideas?
&H27 (change long filename to short filename) works fine, but &H10 (and the rest, too) does not work. I need to change the long directory to short before I change the long filename to short filename, but it isn't happening.
Any ideas?
Code:
FUNCTION dir2$ (fileSpec$, attr) STATIC
DIM dta AS STRING * 44: FileSpecZ$ = fileSpec$ + CHR$(0)
DO: DIM Regs AS RegTypeX
Regs.ax = &H1A00: Regs.ds = VARSEG(dta): Regs.dx = VARPTR(dta)
INTERRUPTX &H21, Regs, Regs
IF FileSpecZ$ <> CHR$(0) THEN
Regs.ax = &H4E00: Regs.cx = attr: Regs.ds = VARSEG(FileSpecZ$)
Regs.dx = SADD(FileSpecZ$)
ELSE Regs.ax = &H4F00
END IF
INTERRUPTX &H21, Regs, Regs
IF Regs.flags AND 1 THEN dir2$ = "": EXIT FUNCTION
RealAttr = ASC(MID$(dta, 22, 1))
IF RealAttr AND attr THEN
Null = INSTR(31, dta, CHR$(0)): dir2$ = MID$(dta, 31, Null - 31)
EXIT FUNCTION
END IF
FileSpecZ$ = CHR$(0): LOOP: END FUNCTION
Peace cannot be obtained without war. Why? If there is already peace, it is unnecessary for war. If there is no peace, there is already war."
Visit www.neobasic.net to see rubbish in all its finest.
Visit www.neobasic.net to see rubbish in all its finest.