Subject: Re: [SWIPL] Annoying problem with filenames as command line arguments

From: Jan Wielemaker <[email-masked]>
Date: Thu, 7 Jun 2001 10:59:31 +0200

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