delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1998/02/04/04:01:15

From: G DOT DegliEsposti AT ads DOT it
To: djgpp AT delorie DOT com
Message-ID: <C12565A1.002FBBA9.00@vega.ads.it>
Date: Wed, 4 Feb 1998 09:46:47 +0100
Subject: Re: System crashing - system( "readme.txt" );
Mime-Version: 1.0




>
> When I run a program with something like "system( "readme.txt" );" in
> the code, the program crashes, both under Windows 95 and DOS 7.
>
> Why?

because "readme.txt" is not an executable file. IIRC system() passes the
string to the shell for execution. This means that the string must
contain a valid command for the shell.

if you try "readme.txt" under command.com you will get "bad command or file
name" (or something like that).

You can try "start readme.txt". It should work for all registered files.

ciao
  Giacomo


- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019