[R] capturing output from Win 98 shell

Simon Fear Simon.Fear at synequanon.com
Tue Aug 12 17:11:53 CEST 2003

Uwe, you suggest

> So you almost got it, just read ?shell carefully enough:
>   filenames <- shell("dir D:\\tmp\\*.sasb7dat /b", intern = TRUE)

Unfortunately, this does not work and is why I wrote to Rhelp (OK I used
system instead of shell, but I tried shell first); here filenames is
character(0) even though the dir output is not empty.

Believe me I did read ?shell many times before I wrote: but I am
that shell does not do what ?shell says it should.

> or even better in this case:
>   filenames <- list.files("d:/tmp", pattern = "sasb7dat")

THANK YOU! I'm always forgetting about file.* and friends. Platform
independent too.

Still leaves me asking the bigger question though: how do I capture DOS
command output in general?

Simon Fear
Senior Statistician
Syne qua non Ltd
Tel: +44 (0) 1379 644449
Fax: +44 (0) 1379 644445
email: Simon.Fear at synequanon.com
web: http://www.synequanon.com
Number of attachments included with this message: 0
This message (and any associated files) is confidential and\...{{dropped}}

More information about the R-help mailing list