s-news
[Top] [All Lists]

Opening a folder in Windows

To: s-news@lists.biostat.wustl.edu
Subject: Opening a folder in Windows
From: Dennis Fisher <fisher@plessthan.com>
Date: Thu, 5 Feb 2009 21:03:55 -0800
Colleagues,

I would like to open a folder from S-Plus (8.0.4) in Windows. A command that works is:
        dos("start FOLDER")
If FOLDER does not contain spaces, this is not a problem.
However, if FOLDER contains spaces (e.g., "Program Files"), the command fails:
        ""Windows cannot find ..."
the problem being that Windows attempts to execute the command on the pre-space portion of FOLDER.

I have tried various means to escape the spaces - backslashes, single quotes, double quotes - to no apparent avail.

I am aware that R has a command:
        shell.exec(FOLDER)
that may address the problem.

Does anyone have a simple solution to this problem, either by escaping the spaces or by allowing use of a command similar to shell.exec for S- Plus?

Thanks for any assistance.

Dennis

Dennis Fisher MD
P < (The "P Less Than" Company)
Phone: 1-866-PLessThan (1-866-753-7784)
Fax: 1-415-564-2220
www.PLessThan.com


<Prev in Thread] Current Thread [Next in Thread>