Using a Directory Alias with @iniwrite fails

  • This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn more.
#1
Code:
c:\users\jlc\documents\dosbox\utils>ver

TCC  22.00.41 x64   Windows 7 [Version 6.1.7601]
I have a directory alias;
Code:
c:\users\jlc\documents\dosbox\utils>alias db:
c:\users\jlc\Documents\dosbox
Using this directory alias with @iniwrite causes it to fail;
Code:
echo %@iniwrite[db:\utils\vdos.ini,vDos,cmd,pause]
-1
Using the actual directory succeeds;
Code:
echo %@iniwrite[c:\users\jlc\documents\dosbox\utils\vdos.ini,vDos,cmd,pause]
0
Is this WAD?

Joe
 

Charles Dye

Super Moderator
Staff member
May 20, 2008
3,483
44
Albuquerque, NM
prospero.unm.edu
#3
I suspect these functions call WritePrivateProfileString() and GetPrivateProfileString() under the hood. These functions are old and funky: if they are passed a filename without a path, Windows assumes the file is in %WINDIR%, not the current directory. Which is why Rex does not canonicalize the filename he passes to them — it would break the documented, longstanding ... weird ... behavior.