dnb(a)csd.abdn.ac.uk writes:
Hi ciao-ers,
does anyone know how to execute a command from within a CIAO session? i want to start JADE from a ciao session using the command
"java jade.Boot -gui"
but i'm not sure how to though i'm told it can be done.
The 'system' library includes several predicates to do this. As an example,
% Load the module into the toplevel:
?- use_module(library(system)). Note: module system already in executable, just made visible
yes ?- system('ls -l'). %% Note it _has_ to be an atom total 2292 drwxr-xr-x 2 boris profesor 4096 Feb 19 19:41 CVS -rw-r--r-- 1 boris profesor 996 Feb 14 17:06 Makefile [...lots of junk...]
yes %% If you have to use an string, you must convert it to an atom first ?- atom_codes(Command, "ls -l"), system(Command).atom_codes(Command, "ls -l"), system(Command). total 2292 drwxr-xr-x 2 boris profesor 4096 Feb 19 19:41 CVS -rw-r--r-- 1 boris profesor 996 Feb 14 17:06 Makefile [...again the same junk...]
Command = 'ls -l' ?
Hope this helps.
Cheeers,
MCL
___________________________________________________________ Never hit a man with glasses. Hit him with a baseball bat. ============================================================================== Message: Address: Action: help majordomo(a)clip.dia.fi.upm.es Info. on useful commands subscribe ciao-users-request(a)clip.dia.fi.upm.es Subscribe to this list unsubscribe ciao-users-request(a)clip.dia.fi.upm.es Unsubscribe from this list <whatever> ciao-users(a)clip.dia.fi.upm.es Send message to list ----------------------------------------------------------------------------- Archived messages: http://www.clip.dia.fi.upm.es/Mail/ciao-users/ -----------------------------------------------------------------------------