Unfortunately, no. .Platform$file.sep on a windows box is the /.
For this DOS program it needs to be the classic backslash.
Ok, we'll hack this a bit (query the platform and test if it is
windows), but now I'm running into escape character problems. Given:
files1=*.las
On 30/06/2011 3:32 PM, Jonathan Greenberg wrote:
Unfortunately, no. .Platform$file.sep on a windows box is the /.
For this DOS program it needs to be the classic backslash.
Ok, we'll hack this a bit (query the platform and test if it is
windows), but now I'm running into escape character
Jonathan Greenberg wrote:
The problem is that I'm trying to create a path to use with a system()
call, and the command window will not work with the forward slash,
only with the standard backslash. I do understand that within R it
will work with either way, but not via the system call.
Hopefully this is a pretty easy fix -- I need to have R query the path
separator for some code I'm trying to write (it involves using a
system() call) -- the call requires a path and a wildcard, e.g.:
command=mycommand /path/to/*.files in the case of unix or,
command=mycommand.exe
See file.path().
/Henrik
On Tue, Jun 28, 2011 at 6:59 PM, Jonathan Greenberg
greenb...@ucdavis.edu wrote:
Hopefully this is a pretty easy fix -- I need to have R query the path
separator for some code I'm trying to write (it involves using a
system() call) -- the call requires a path and a
Thanks Henrik, but as the help for this function states:
Note
The components are separated by / (not \) on Windows.
, the slashes it uses are incorrect for use in a CMD window on a
Windows box (they need to be \ but file.path uses /). I suppose I can
do a query as to whether the platform is
Windows will work with either separator.
---
Jeff Newmiller The . . Go Live...
DCN:jdnew...@dcn.davis.ca.us Basics: ##.#. ##.#. Live Go...
Live: OO#.. Dead: OO#.. Playing
Research Engineer (Solar/Batteries O.O#. #.O#.
The problem is that I'm trying to create a path to use with a system()
call, and the command window will not work with the forward slash,
only with the standard backslash. I do understand that within R it
will work with either way, but not via the system call. I'm trying to
create a generic
8 matches
Mail list logo