From jan@swi.psy.uva.nl Thu Jun  7 11:04:00 2001
Received: from gollem.swi.psy.uva.nl (root@gollem [145.18.152.30])
	by swi.psy.uva.nl (8.11.2/8.11.2) with ESMTP id f57940320206;
	Thu, 7 Jun 2001 11:04:00 +0200 (MET DST)
Received: from localhost (localhost [[UNIX: localhost]])
	by gollem.swi.psy.uva.nl (8.11.2/8.11.2/SuSE Linux 8.11.1-0.5) id f57940r05649;
	Thu, 7 Jun 2001 11:04:00 +0200
From: Jan Wielemaker <jan@swi.psy.uva.nl>
Organization: SWI, University of Amsterdam
To: "Michael A. Covington" <mc@ai.uga.edu>, <prolog@swi.psy.uva.nl>
Subject: Re: [SWIPL] Annoying problem with filenames as command line arguments
Date: Thu, 7 Jun 2001 10:59:31 +0200
X-Mailer: KMail [version 1.0.29.2]
Content-Type: text/plain
References: <004601c0eee2$c8365f40$c901a8c0@MINERVA>
In-Reply-To: <004601c0eee2$c8365f40$c901a8c0@MINERVA>
MIME-Version: 1.0
Message-Id: <01060711035900.04979@gollem>
Content-Transfer-Encoding: 8bit

On Thu, 07 Jun 2001, Michael A. Covington wrote:
>I am trying to use SWI-Prolog as a script engine under Windows 2000, using
>an IIS command template like:
>
>"C:\Program Files\pl\bin\plcon.exe" -f %s -g start -t halt
>
>That means: Load the file %s (where %s stands for the filename passed by the
>CGI engine), then execute goal 'start', and afterward or upon hitting any
>error, halt.
>
>The problem:  Windows passes file names to script engines as full paths,
>such as 'c:\inetpub\scripts\myscript.swi', but SWI-Prolog will *not* accept
>these.  It wants forward slashes or double backslashes.
>
>I think that whatever else a Prolog system wants to do about filenames, on
>the command line it ought to accept filenames in the operating system's
>native format.  Is there a workaround?  I tried putting quotes, backquotes,
>etc., around '%s' and it didn't help.  I can devise a klugey workaround
>using cmd.exe, if absolutely necessary, but it's ugly.

Easier is to upgrade to version 4.0.5 or later, where this problem has
been fixed.  If you really don't want, look at the CVS history of
boot/toplevel.pl, where you will find the required patch.

This version also provides the -q flag to make the system silent (i.e.
suppress all `informational' messages, only leaving warnings and
errors), very handy when scripting!

	--- Jan

