Category : C Source Code
Archive   : FILE_IO.ZIP
Filename : TRUENAME.C
Output of file : TRUENAME.C contained in archive : FILE_IO.ZIP
Copyright 1991 by David Thielen, All Rights Reserved.
This code example is from a commercial product and has restricted
rights. This code, or any code derived from this code may be
incorporated into any programs with the following restrictions;
1) It cannot be sold as source code, and 2) It cannot be sold in a
product which provides this code as an API.
*/
#include "file_io.h"
#include "string.h"
// Convert the file name in pFile to the true name (elim append, join, &
// subst) and put it in pTrue. On an error, will return the passed in
// name.
unsigned FileTrueName (BYTE const *pFile,BYTE *pTrue)
{
unsigned uRtn;
#ifdef DEBUG
if ((! pFile) || (! pTrue) || (! *pFile))
DebugPrintf ("TrueName (%s(%X), (%X))\n", pFile, pFile, pTrue);
memset (pTrue, '$', 128);
#endif
// Before DOS 3 - can't do it.
// Return the passed in name so you have something
if (DosMajVer < 3)
{
strcpy (pTrue, pFile);
return (-1);
}
*pTrue = 0;
_asm
{
mov ax, 6000h
mov si, [pFile]
mov di, [pTrue]
push ds
pop es
int 21h // Convert file name
mov [uRtn], ax
jc dne
mov [uRtn], 0
dne:
}
if (uRtn)
strcpy (pTrue, pFile);
return (uRtn);
}
Very nice! Thank you for this wonderful archive. I wonder why I found it only now. Long live the BBS file archives!
This is so awesome! 😀 I’d be cool if you could download an entire archive of this at once, though.
But one thing that puzzles me is the “mtswslnkmcjklsdlsbdmMICROSOFT” string. There is an article about it here. It is definitely worth a read: http://www.os2museum.com/wp/mtswslnk/