Category : Miscellaneous Language Source Code
Archive   : MTD.ZIP
Filename : BADCLOSE.PAS

 
Output of file : BADCLOSE.PAS contained in archive : MTD.ZIP
program badClose;

type
s65 = string[65]; { file names }

{$i-}
function fileExists( fileName : s65 ) : Boolean;
var
f : file;
begin
assign( f, fileName );
reset( f );
fileExists := ioResult = 0;
close( f ); { Bug !!! }
end; { fileExists }
{$i+}

var
filename : s65;

begin
write( 'Enter file name to check ' );
readln( filename );
if fileExists( fileName )
then writeln( filename, ' exists' )
else writeln( filename, ' does not exist' );
writeln( 'End of program' );
end.


  3 Responses to “Category : Miscellaneous Language Source Code
Archive   : MTD.ZIP
Filename : BADCLOSE.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/