[rkward-devel] system calls with JS?
Thomas Friedrichsmeier
thomas.friedrichsmeier at ruhr-uni-bochum.de
Thu Mar 11 09:50:24 UTC 2010
Hi,
On Wednesday 10 March 2010, meik michalke wrote:
> yes and no: R can do system calls, and it actually does that later in my
> plugin. on the other hand, the previous PHP system call is used to check
> paths to the needed executables, to then *generate* the R system calls
> with the collected information (see below).
yes, understood. What I mean is, why not just generate the following R code
unconditionally (just a sketch):
# locate required tools
pdflatex.cmd <- Sys.which ("pdflatex")
pdftk.cmd <- Sys.which ("pdftk")
if ((pdflatex.cmd == "") | (pdftk.cmd == "")) stop ("Could not find all required
tools")
# set up temporary directory
dir <- tempfile ("klausuR")
if (!dir.create (dir, recursive=TRUE)) stop ("Could not create temporary dir")
on.exit (unlink (dir))
# ok, we're set to go
cmd <- paste (..., pdflatex.cmd, ..., pdftk.cmd, ...)
System (cmd)
I.e. simply move the logic into the generated R code.
Regards
Thomas
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 198 bytes
Desc: This is a digitally signed message part.
URL: <http://mail.kde.org/pipermail/rkward-devel/attachments/20100311/f5f3cee6/attachment.sig>
More information about the Rkward-devel
mailing list