Category : Pascal Source Code
Archive   : TPCM9406.ZIP
Filename : CODE018.PAS

 
Output of file : CODE018.PAS contained in archive : TPCM9406.ZIP
{
RP>Is there a way to check if the directory is there before it attempts to
>make it?


PSEUDOCODE:
-----------

Check for directory
it exists -> Exec
if not -> halt or ignore

-----------
}

Procedure CheckandExec(program,dir:string);

var startdir : string;
result : byte;
Begin
getdir(0,startdir); {store original dir }
chdir(startdir[1] + ':\'); {goto root }
result := Fsearch(dir,startdir[1] + ':\'); {search for dir from }
{root dir }
chdir(startdir);
if result <> ''
then
Begin
Swapvectors; {Protect from child }
Exec(GetEnv('COMSPEC'),'/C ',program,' >NUL') { exec }
Swapvectors; {Restore orig. vects}
End
else halt(0);
End;

{
---
* Origin: The Power Supply - Tampa, Fl - (813)949-7153 (1:377/64)
}


  3 Responses to “Category : Pascal Source Code
Archive   : TPCM9406.ZIP
Filename : CODE018.PAS

  1. Very nice! Thank you for this wonderful archive. I wonder why I found it only now. Long live the BBS file archives!

  2. This is so awesome! 😀 I’d be cool if you could download an entire archive of this at once, though.

  3. 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/