On Win32 systems, shell/[1,2]
executes the command using the CreateProcess() API and waits for the
command to terminate. If the command ends with a &
sign, the command is handed to the WinExec() API, which does not wait
for the new task to terminate. See also win_exec/2.
Please note that the CreateProcess() API does not imply the
Windows command interpreter (command.exe on Windows 95/98 and cmd.exe
on Windows-NT) and therefore commands built-in to the
command-interpreter can only be activated using the command interpreter.
For example: 'command.exe /C copy file1.txt file2.txt'
shell(Command, 0)
'.
/bin/sh
, the
environment variable SHELL
overrides this default. Not
available for Win32 platforms.
iconic
or normal
and dictates the initial status of the window. The iconic
option is notably handy to start (DDE) servers.
DWORD
, the value is returned as an integer. If the value is
a string it is returned as a Prolog atom. Other types are currently not
supported. The default `root' is HKEY_CURRENT_USER
. Other
roots can be specified explicitely as HKEY_CLASSES_ROOT
,
HKEY_CURRENT_USER
, HKEY_LOCAL_MACHINE
or
HKEY_USERS
. The example below fetches the extension to use
for Prolog files (see README.TXT
on the Windows version):
?- win_registry_get_value('HKEY_LOCAL_MACHINE/Software/SWI/Prolog', fileExtension, Ext). Ext = pl |
chdir(~)
. Use for compatibility only.
--
. Integer
arguments are passed as Prolog integers, float arguments and Prolog
floating point numbers and all other arguments as Prolog atoms. New
applications should use the prolog-flag argv
.
A stand-alone program could use the following skeleton to handle command-line arguments. See also section 2.10.2.3.
main :- unix(argv(Argv)), append(_PrologArgs, [--|AppArgs], Argv), !, main(AppArgs). |