Re: [R] Querying the path separator?

2011-06-30 Thread Jonathan Greenberg
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

Re: [R] Querying the path separator?

2011-06-30 Thread Duncan Murdoch
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

Re: [R] Querying the path separator?

2011-06-29 Thread Berend Hasselman
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.

[R] Querying the path separator?

2011-06-28 Thread Jonathan Greenberg
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

Re: [R] Querying the path separator?

2011-06-28 Thread Henrik Bengtsson
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

Re: [R] Querying the path separator?

2011-06-28 Thread Jonathan Greenberg
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

Re: [R] Querying the path separator?

2011-06-28 Thread Jeff Newmiller
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#.

Re: [R] Querying the path separator?

2011-06-28 Thread Jonathan Greenberg
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