-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
I'm writing a script that generates a data file for a C program. It
saves the data file in the specified directory, calls the C program
(located in the same directory), reads the output file produced by the C
program (also in that directory), and then displays the results in
graphs or tables.
I'm using fwrites, freads, and their kin for writing and reading the
files, and I'm trying to use shell out of tasks.ijs to call the C
program.
Is there a way from inside a J script to set a present working
directory, or is the common approach to append the path and the file
name each time you address a file? I seem to recall something, but
I'm drawing a blank. FWIW, I'm on Windows with cygwin.
It would seem nice to do the equivalent of
cd "c:/arbitrary path with spaces/"
./executable data
inside J, especially since "c:/path with spaces/" won't change
often.
We've written about shell and tasks.ijs before, but I seem to be stuck
again, thanks to spaces in file names, I think.
I'm trying to execute a command of the form
shell 'c:/arbitrary path with spaces/executable c:/arbitrary path \
with spaces/data'
and later read 'c:/arbitrary path with spaces/output' with freads.
Does anyone have a sample 'shell' command that references files like
that in cygwin? Everything I seem to try ends up with the J error
,----
| 'c:/documents\' is not recognized as an internal or external command,
| operable program or batch file.
`----
I've tried enclosing the FQPN of both files in double quotes and
enclosing each FQPN in double quotes, and I've tried escaping the
spaces and not escaping the spaces.
Thanks,
Bill
- --
Bill Harris http://facilitatedsystems.com/weblog/
Facilitated Systems Everett, WA 98208 USA
http://facilitatedsystems.com/ phone: +1 425 337-5541
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.3 (MingW32)
Comment: For more information, see http://www.gnupg.org
iD8DBQFF5yKH3J3HaQTDvd8RAsBHAJwLRN2B7Y+heeE1VeFHkoT90k+vKwCfbQ2O
Mgemxc6nLuEMvBL3WO/DCWU=
=Xtgw
-----END PGP SIGNATURE-----
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm