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

From: "Michael A. Covington" <[email-masked]>
Date: Wed, 6 Jun 2001 19:45:34 -0400

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.

Michael A. Covington - Artificial Intelligence Ctr
The University of Georgia - Athens, GA 30602-7415 USA
http://www.CovingtonInnovations.com  http://www.ai.uga.edu/~mc <><