An embedded and charset-unspecified text was scrubbed... Name: not available URL: <https://stat.ethz.ch/pipermail/r-help/attachments/20100106/5f1dfc71/attachment.pl>
Calling FING.EXE under RGui.EXE for windows.
22 messages · John Schexnayder, Uwe Ligges, Henrik Bengtsson +2 more
If you have C:\Rtools\bin on your PATH note that it contains a UNIX-like find utility that conflicts with the find utility in Windows. If that is the problem then remove that from your PATH and then run the batch file. The batchfiles distribution at http://batchfiles.googlecode.com has utilities (Rgui.bat, R.bat, Rtools.bat, etc.) that will automatically add C:\Rtools\bin to your path temporarily or only while R is running so that you can leave it off your PATH.
On Wed, Jan 6, 2010 at 6:51 PM, John Schexnayder <jschex at us.ibm.com> wrote:
This is sort of a strange bug. ?Not show stopping, but annoying. ?I was
wondering if anyone else has noticed this and reported it before I submit
a bug report.
I noticed while running the RGui and attempting to debug one of my scripts
that I encountered a Windows error informing me that "Find String [grep]
Utility has encountered a problem and needs to close." ?It is being
generated by a call to a DOS batch file which contains a call to Find.exe.
?It can be reproduced by simply typing ?"System("find")" in RGui. ?What I
found strange is that I have been running this script daily without this
problem for months. ?I now realize I never ran that portion of the script
while in RGui.exe. ?It has always run in batch mode which is done by
Rterm.exe.
I have tried this on three separate machines now all running Windows XP
SP3, with versions of R 2.8.1 and R 2.10.1 ?If executing "System("find")
under RGui, an error window for the Find String Utility is generated and
the command is not exectuted. ?If the same command is issued in Rterm the
expected "FIND: Parameter format not correct" message is properly
returned.
It doesn't seem an important bug, but it could be the canary in the mine
for a larger problem somewhere down the road.
Re,
John Schexnayder
IBM Tape Manufacturing - Information Technology
San Jose, CA ?95138
JSchex at us.ibm.com
? ? ? ?[[alternative HTML version deleted]]
______________________________________________ R-help at r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
On 07.01.2010 02:04, Gabor Grothendieck wrote:
If you have C:\Rtools\bin on your PATH note that it contains a UNIX-like find utility that conflicts with the find utility in Windows. If that is the problem then remove that from your PATH and then run the batch file. The batchfiles distribution at http://batchfiles.googlecode.com has utilities (Rgui.bat, R.bat, Rtools.bat, etc.) that will automatically add C:\Rtools\bin to your path temporarily or only while R is running so that you can leave it off your PATH.
I guess it's the use of system() rather than shell() that causes the problem. Under Windows, you have to use shell in order to start a command interpreter. Uwe Ligges
On Wed, Jan 6, 2010 at 6:51 PM, John Schexnayder<jschex at us.ibm.com> wrote:
This is sort of a strange bug. Not show stopping, but annoying. I was
wondering if anyone else has noticed this and reported it before I submit
a bug report.
I noticed while running the RGui and attempting to debug one of my scripts
that I encountered a Windows error informing me that "Find String [grep]
Utility has encountered a problem and needs to close." It is being
generated by a call to a DOS batch file which contains a call to Find.exe.
It can be reproduced by simply typing "System("find")" in RGui. What I
found strange is that I have been running this script daily without this
problem for months. I now realize I never ran that portion of the script
while in RGui.exe. It has always run in batch mode which is done by
Rterm.exe.
I have tried this on three separate machines now all running Windows XP
SP3, with versions of R 2.8.1 and R 2.10.1 If executing "System("find")
under RGui, an error window for the Find String Utility is generated and
the command is not exectuted. If the same command is issued in Rterm the
expected "FIND: Parameter format not correct" message is properly
returned.
It doesn't seem an important bug, but it could be the canary in the mine
for a larger problem somewhere down the road.
Re,
John Schexnayder
IBM Tape Manufacturing - Information Technology
San Jose, CA 95138
JSchex at us.ibm.com
[[alternative HTML version deleted]]
______________________________________________ R-help at r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
______________________________________________ R-help at r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
I get a problem with shell too: Under Rgui:
R.version.string
[1] "R version 2.10.1 Patched (2010-01-01 r50884)"
system("C:\\windows\\system32\\find /?", intern = TRUE)
character(0)
system("cmd /c C:\\windows\\system32\\find /?", intern = TRUE)
character(0)
shell("C:\\windows\\system32\\find /?")
Warning message:
In shell("C:\\windows\\system32\\find /?") :
'C:\windows\system32\find /?' execution failed with error code 1
They all work, i.e. they give the required help message, under Rterm
and when I issue this from the Windows console it works:
C:\windows\system32\find /?
2010/1/7 Uwe Ligges <ligges at statistik.tu-dortmund.de>:
On 07.01.2010 02:04, Gabor Grothendieck wrote:
If you have C:\Rtools\bin on your PATH note that it contains a UNIX-like find utility that conflicts with the find utility in Windows. ?If that is the problem then remove that from your PATH and then run the batch file. The batchfiles distribution at http://batchfiles.googlecode.com ?has utilities (Rgui.bat, R.bat, Rtools.bat, etc.) that will automatically add C:\Rtools\bin to your path temporarily or only while R is running so that you can leave it off your PATH.
I guess it's the use of system() rather than shell() that causes the problem. Under Windows, you have to use shell in order to start a command interpreter. Uwe Ligges
On Wed, Jan 6, 2010 at 6:51 PM, John Schexnayder<jschex at us.ibm.com> ?wrote:
This is sort of a strange bug. ?Not show stopping, but annoying. ?I was
wondering if anyone else has noticed this and reported it before I submit
a bug report.
I noticed while running the RGui and attempting to debug one of my
scripts
that I encountered a Windows error informing me that "Find String [grep]
Utility has encountered a problem and needs to close." ?It is being
generated by a call to a DOS batch file which contains a call to
Find.exe.
?It can be reproduced by simply typing ?"System("find")" in RGui. ?What I
found strange is that I have been running this script daily without this
problem for months. ?I now realize I never ran that portion of the script
while in RGui.exe. ?It has always run in batch mode which is done by
Rterm.exe.
I have tried this on three separate machines now all running Windows XP
SP3, with versions of R 2.8.1 and R 2.10.1 ?If executing "System("find")
under RGui, an error window for the Find String Utility is generated and
the command is not exectuted. ?If the same command is issued in Rterm the
expected "FIND: Parameter format not correct" message is properly
returned.
It doesn't seem an important bug, but it could be the canary in the mine
for a larger problem somewhere down the road.
Re,
John Schexnayder
IBM Tape Manufacturing - Information Technology
San Jose, CA ?95138
JSchex at us.ibm.com
? ? ? ?[[alternative HTML version deleted]]
______________________________________________ R-help at r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
______________________________________________ R-help at r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
Argh. I see it as well. Will dig a lit tomorrow. Uwe
On 07.01.2010 12:25, Gabor Grothendieck wrote:
I get a problem with shell too: Under Rgui:
R.version.string
[1] "R version 2.10.1 Patched (2010-01-01 r50884)"
system("C:\\windows\\system32\\find /?", intern = TRUE)
character(0)
system("cmd /c C:\\windows\\system32\\find /?", intern = TRUE)
character(0)
shell("C:\\windows\\system32\\find /?")
Warning message:
In shell("C:\\windows\\system32\\find /?") :
'C:\windows\system32\find /?' execution failed with error code 1
They all work, i.e. they give the required help message, under Rterm
and when I issue this from the Windows console it works:
C:\windows\system32\find /?
2010/1/7 Uwe Ligges<ligges at statistik.tu-dortmund.de>:
On 07.01.2010 02:04, Gabor Grothendieck wrote:
If you have C:\Rtools\bin on your PATH note that it contains a UNIX-like find utility that conflicts with the find utility in Windows. If that is the problem then remove that from your PATH and then run the batch file. The batchfiles distribution at http://batchfiles.googlecode.com has utilities (Rgui.bat, R.bat, Rtools.bat, etc.) that will automatically add C:\Rtools\bin to your path temporarily or only while R is running so that you can leave it off your PATH.
I guess it's the use of system() rather than shell() that causes the problem. Under Windows, you have to use shell in order to start a command interpreter. Uwe Ligges
On Wed, Jan 6, 2010 at 6:51 PM, John Schexnayder<jschex at us.ibm.com> wrote:
This is sort of a strange bug. Not show stopping, but annoying. I was
wondering if anyone else has noticed this and reported it before I submit
a bug report.
I noticed while running the RGui and attempting to debug one of my
scripts
that I encountered a Windows error informing me that "Find String [grep]
Utility has encountered a problem and needs to close." It is being
generated by a call to a DOS batch file which contains a call to
Find.exe.
It can be reproduced by simply typing "System("find")" in RGui. What I
found strange is that I have been running this script daily without this
problem for months. I now realize I never ran that portion of the script
while in RGui.exe. It has always run in batch mode which is done by
Rterm.exe.
I have tried this on three separate machines now all running Windows XP
SP3, with versions of R 2.8.1 and R 2.10.1 If executing "System("find")
under RGui, an error window for the Find String Utility is generated and
the command is not exectuted. If the same command is issued in Rterm the
expected "FIND: Parameter format not correct" message is properly
returned.
It doesn't seem an important bug, but it could be the canary in the mine
for a larger problem somewhere down the road.
Re,
John Schexnayder
IBM Tape Manufacturing - Information Technology
San Jose, CA 95138
JSchex at us.ibm.com
[[alternative HTML version deleted]]
______________________________________________ R-help at r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
______________________________________________ R-help at r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
No paths for shell() - instead throw it commands as if you were at the
Windows command prompt, i.e.
res <- shell("find", intern=TRUE);
str(res);
chr [1:3454] "." "./.Rhistory" "./aroma.affymetrix" ...
/H
2010/1/7 Uwe Ligges <ligges at statistik.tu-dortmund.de>:
Argh. I see it as well. Will dig a lit tomorrow. Uwe On 07.01.2010 12:25, Gabor Grothendieck wrote:
I get a problem with shell too: Under Rgui:
R.version.string
[1] "R version 2.10.1 Patched (2010-01-01 r50884)"
system("C:\\windows\\system32\\find /?", intern = TRUE)
character(0)
system("cmd /c C:\\windows\\system32\\find /?", intern = TRUE)
character(0)
shell("C:\\windows\\system32\\find /?")
Warning message:
In shell("C:\\windows\\system32\\find /?") :
?'C:\windows\system32\find /?' execution failed with error code 1
They all work, i.e. they give the required help message, under Rterm
and when I issue this from the Windows console it works:
C:\windows\system32\find /?
2010/1/7 Uwe Ligges<ligges at statistik.tu-dortmund.de>:
On 07.01.2010 02:04, Gabor Grothendieck wrote:
If you have C:\Rtools\bin on your PATH note that it contains a UNIX-like find utility that conflicts with the find utility in Windows. ?If that is the problem then remove that from your PATH and then run the batch file. The batchfiles distribution at http://batchfiles.googlecode.com ?has utilities (Rgui.bat, R.bat, Rtools.bat, etc.) that will automatically add C:\Rtools\bin to your path temporarily or only while R is running so that you can leave it off your PATH.
I guess it's the use of system() rather than shell() that causes the problem. Under Windows, you have to use shell in order to start a command interpreter. Uwe Ligges
On Wed, Jan 6, 2010 at 6:51 PM, John Schexnayder<jschex at us.ibm.com> ?wrote:
This is sort of a strange bug. ?Not show stopping, but annoying. ?I was
wondering if anyone else has noticed this and reported it before I
submit
a bug report.
I noticed while running the RGui and attempting to debug one of my
scripts
that I encountered a Windows error informing me that "Find String
[grep]
Utility has encountered a problem and needs to close." ?It is being
generated by a call to a DOS batch file which contains a call to
Find.exe.
?It can be reproduced by simply typing ?"System("find")" in RGui. ?What
I
found strange is that I have been running this script daily without
this
problem for months. ?I now realize I never ran that portion of the
script
while in RGui.exe. ?It has always run in batch mode which is done by
Rterm.exe.
I have tried this on three separate machines now all running Windows XP
SP3, with versions of R 2.8.1 and R 2.10.1 ?If executing
"System("find")
under RGui, an error window for the Find String Utility is generated
and
the command is not exectuted. ?If the same command is issued in Rterm
the
expected "FIND: Parameter format not correct" message is properly
returned.
It doesn't seem an important bug, but it could be the canary in the
mine
for a larger problem somewhere down the road.
Re,
John Schexnayder
IBM Tape Manufacturing - Information Technology
San Jose, CA ?95138
JSchex at us.ibm.com
? ? ? ?[[alternative HTML version deleted]]
______________________________________________ R-help at r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
______________________________________________ R-help at r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
______________________________________________ R-help at r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
My bad, I jumped in to late in the thread and missed the fact that it does not work with Rgui.exe (and that it works with Rterm.exe). Problem replicated/remains. /H
On Thu, Jan 7, 2010 at 11:10 AM, Henrik Bengtsson <hb at stat.berkeley.edu> wrote:
No paths for shell() - instead throw it commands as if you were at the
Windows command prompt, i.e.
res <- shell("find", intern=TRUE);
str(res);
?chr [1:3454] "." "./.Rhistory" "./aroma.affymetrix" ...
/H
2010/1/7 Uwe Ligges <ligges at statistik.tu-dortmund.de>:
Argh. I see it as well. Will dig a lit tomorrow. Uwe On 07.01.2010 12:25, Gabor Grothendieck wrote:
I get a problem with shell too: Under Rgui:
R.version.string
[1] "R version 2.10.1 Patched (2010-01-01 r50884)"
system("C:\\windows\\system32\\find /?", intern = TRUE)
character(0)
system("cmd /c C:\\windows\\system32\\find /?", intern = TRUE)
character(0)
shell("C:\\windows\\system32\\find /?")
Warning message:
In shell("C:\\windows\\system32\\find /?") :
?'C:\windows\system32\find /?' execution failed with error code 1
They all work, i.e. they give the required help message, under Rterm
and when I issue this from the Windows console it works:
C:\windows\system32\find /?
2010/1/7 Uwe Ligges<ligges at statistik.tu-dortmund.de>:
On 07.01.2010 02:04, Gabor Grothendieck wrote:
If you have C:\Rtools\bin on your PATH note that it contains a UNIX-like find utility that conflicts with the find utility in Windows. ?If that is the problem then remove that from your PATH and then run the batch file. The batchfiles distribution at http://batchfiles.googlecode.com ?has utilities (Rgui.bat, R.bat, Rtools.bat, etc.) that will automatically add C:\Rtools\bin to your path temporarily or only while R is running so that you can leave it off your PATH.
I guess it's the use of system() rather than shell() that causes the problem. Under Windows, you have to use shell in order to start a command interpreter. Uwe Ligges
On Wed, Jan 6, 2010 at 6:51 PM, John Schexnayder<jschex at us.ibm.com> ?wrote:
This is sort of a strange bug. ?Not show stopping, but annoying. ?I was
wondering if anyone else has noticed this and reported it before I
submit
a bug report.
I noticed while running the RGui and attempting to debug one of my
scripts
that I encountered a Windows error informing me that "Find String
[grep]
Utility has encountered a problem and needs to close." ?It is being
generated by a call to a DOS batch file which contains a call to
Find.exe.
?It can be reproduced by simply typing ?"System("find")" in RGui. ?What
I
found strange is that I have been running this script daily without
this
problem for months. ?I now realize I never ran that portion of the
script
while in RGui.exe. ?It has always run in batch mode which is done by
Rterm.exe.
I have tried this on three separate machines now all running Windows XP
SP3, with versions of R 2.8.1 and R 2.10.1 ?If executing
"System("find")
under RGui, an error window for the Find String Utility is generated
and
the command is not exectuted. ?If the same command is issued in Rterm
the
expected "FIND: Parameter format not correct" message is properly
returned.
It doesn't seem an important bug, but it could be the canary in the
mine
for a larger problem somewhere down the road.
Re,
John Schexnayder
IBM Tape Manufacturing - Information Technology
San Jose, CA ?95138
JSchex at us.ibm.com
? ? ? ?[[alternative HTML version deleted]]
______________________________________________ R-help at r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
______________________________________________ R-help at r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
______________________________________________ R-help at r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
2 days later
On 07/01/2010 1:25 PM, Uwe Ligges wrote:
Argh. I see it as well. Will dig a lit tomorrow.
I don't know exactly what's going on, but it looks as though it is something specific to the find.exe utility, e.g. maybe it is assuming that it's being run inside a console and reading CONIN$ or writing to CONOUT$ without checking whether they can be opened. When you run it from Rterm, Rterm is in a console, which appears to be good enough. So it may be anyone who wants to use it will have to contact Microsoft to find out how... Duncan Murdoch
Uwe On 07.01.2010 12:25, Gabor Grothendieck wrote:
I get a problem with shell too: Under Rgui:
R.version.string
[1] "R version 2.10.1 Patched (2010-01-01 r50884)"
system("C:\\windows\\system32\\find /?", intern = TRUE)
character(0)
system("cmd /c C:\\windows\\system32\\find /?", intern = TRUE)
character(0)
shell("C:\\windows\\system32\\find /?")
Warning message:
In shell("C:\\windows\\system32\\find /?") :
'C:\windows\system32\find /?' execution failed with error code 1
They all work, i.e. they give the required help message, under Rterm
and when I issue this from the Windows console it works:
C:\windows\system32\find /?
2010/1/7 Uwe Ligges<ligges at statistik.tu-dortmund.de>:
On 07.01.2010 02:04, Gabor Grothendieck wrote:
If you have C:\Rtools\bin on your PATH note that it contains a UNIX-like find utility that conflicts with the find utility in Windows. If that is the problem then remove that from your PATH and then run the batch file. The batchfiles distribution at http://batchfiles.googlecode.com has utilities (Rgui.bat, R.bat, Rtools.bat, etc.) that will automatically add C:\Rtools\bin to your path temporarily or only while R is running so that you can leave it off your PATH.
I guess it's the use of system() rather than shell() that causes the problem. Under Windows, you have to use shell in order to start a command interpreter. Uwe Ligges
On Wed, Jan 6, 2010 at 6:51 PM, John Schexnayder<jschex at us.ibm.com> wrote:
This is sort of a strange bug. Not show stopping, but annoying. I was
wondering if anyone else has noticed this and reported it before I submit
a bug report.
I noticed while running the RGui and attempting to debug one of my
scripts
that I encountered a Windows error informing me that "Find String [grep]
Utility has encountered a problem and needs to close." It is being
generated by a call to a DOS batch file which contains a call to
Find.exe.
It can be reproduced by simply typing "System("find")" in RGui. What I
found strange is that I have been running this script daily without this
problem for months. I now realize I never ran that portion of the script
while in RGui.exe. It has always run in batch mode which is done by
Rterm.exe.
I have tried this on three separate machines now all running Windows XP
SP3, with versions of R 2.8.1 and R 2.10.1 If executing "System("find")
under RGui, an error window for the Find String Utility is generated and
the command is not exectuted. If the same command is issued in Rterm the
expected "FIND: Parameter format not correct" message is properly
returned.
It doesn't seem an important bug, but it could be the canary in the mine
for a larger problem somewhere down the road.
Re,
John Schexnayder
IBM Tape Manufacturing - Information Technology
San Jose, CA 95138
JSchex at us.ibm.com
[[alternative HTML version deleted]]
______________________________________________ R-help at r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
______________________________________________ R-help at r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
______________________________________________ R-help at r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
That doesn't explain why this returns character(o) even though we have
launched a console for it:
system("cmd /c C:\\windows\\system32\\find /?", intern = TRUE)
On Sat, Jan 9, 2010 at 5:24 PM, Duncan Murdoch <murdoch at stats.uwo.ca> wrote:
On 07/01/2010 1:25 PM, Uwe Ligges wrote:
Argh. I see it as well. Will dig a lit tomorrow.
I don't know exactly what's going on, but it looks as though it is something specific to the find.exe utility, e.g. maybe it is assuming that it's being run inside a console and reading CONIN$ or writing to CONOUT$ without checking whether they can be opened. ?When you run it from Rterm, Rterm is in a console, which appears to be good enough. So it may be anyone who wants to use it will have to contact Microsoft to find out how... Duncan Murdoch
Uwe On 07.01.2010 12:25, Gabor Grothendieck wrote:
I get a problem with shell too: Under Rgui:
R.version.string
[1] "R version 2.10.1 Patched (2010-01-01 r50884)"
system("C:\\windows\\system32\\find /?", intern = TRUE)
character(0)
system("cmd /c C:\\windows\\system32\\find /?", intern = TRUE)
character(0)
shell("C:\\windows\\system32\\find /?")
Warning message:
In shell("C:\\windows\\system32\\find /?") :
?'C:\windows\system32\find /?' execution failed with error code 1
They all work, i.e. they give the required help message, under Rterm
and when I issue this from the Windows console it works:
C:\windows\system32\find /?
2010/1/7 Uwe Ligges<ligges at statistik.tu-dortmund.de>:
On 07.01.2010 02:04, Gabor Grothendieck wrote:
If you have C:\Rtools\bin on your PATH note that it contains a UNIX-like find utility that conflicts with the find utility in Windows. ?If that is the problem then remove that from your PATH and then run the batch file. The batchfiles distribution at http://batchfiles.googlecode.com ?has utilities (Rgui.bat, R.bat, Rtools.bat, etc.) that will automatically add C:\Rtools\bin to your path temporarily or only while R is running so that you can leave it off your PATH.
I guess it's the use of system() rather than shell() that causes the problem. Under Windows, you have to use shell in order to start a command interpreter. Uwe Ligges
On Wed, Jan 6, 2010 at 6:51 PM, John Schexnayder<jschex at us.ibm.com> ?wrote:
This is sort of a strange bug. ?Not show stopping, but annoying. ?I
was
wondering if anyone else has noticed this and reported it before I
submit
a bug report.
I noticed while running the RGui and attempting to debug one of my
scripts
that I encountered a Windows error informing me that "Find String
[grep]
Utility has encountered a problem and needs to close." ?It is being
generated by a call to a DOS batch file which contains a call to
Find.exe.
?It can be reproduced by simply typing ?"System("find")" in RGui.
?What I
found strange is that I have been running this script daily without
this
problem for months. ?I now realize I never ran that portion of the
script
while in RGui.exe. ?It has always run in batch mode which is done by
Rterm.exe.
I have tried this on three separate machines now all running Windows
XP
SP3, with versions of R 2.8.1 and R 2.10.1 ?If executing
"System("find")
under RGui, an error window for the Find String Utility is generated
and
the command is not exectuted. ?If the same command is issued in Rterm
the
expected "FIND: Parameter format not correct" message is properly
returned.
It doesn't seem an important bug, but it could be the canary in the
mine
for a larger problem somewhere down the road.
Re,
John Schexnayder
IBM Tape Manufacturing - Information Technology
San Jose, CA ?95138
JSchex at us.ibm.com
? ? ? ?[[alternative HTML version deleted]]
______________________________________________ R-help at r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
______________________________________________ R-help at r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
______________________________________________ R-help at r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
On 09/01/2010 6:31 PM, Gabor Grothendieck wrote:
That doesn't explain why this returns character(o) even though we have
launched a console for it:
system("cmd /c C:\\windows\\system32\\find /?", intern = TRUE)
I don't see any console launched. R redirects stdin and stdout (and
stderr, I think), and it appears that Windows doesn't open a console. I
do see a console flash by if I do
system('cmd /c c:/WINDOWS/system32/find.exe /?', wait=FALSE,
invisible=FALSE)
but of course then we don't capture the output, so it's not very useful.
Looking at the source, the only case where we ask to create a console
is the combination "wait=FALSE, invisible=FALSE", but there might be
combinations of other options that make this a default. The MS
documentation says that a console will be created automatically for any
console application, but that doesn't appear to be happening.
So I guess you could get find.exe to work by calling it from a batch
file with a "pause" at the end and using the wait=FALSE,invisible=FALSE
options.
The above observations are in Win XP SP3, not anything newer.
Duncan Murdoch
On Sat, Jan 9, 2010 at 5:24 PM, Duncan Murdoch <murdoch at stats.uwo.ca> wrote:
On 07/01/2010 1:25 PM, Uwe Ligges wrote:
Argh. I see it as well. Will dig a lit tomorrow.
I don't know exactly what's going on, but it looks as though it is something specific to the find.exe utility, e.g. maybe it is assuming that it's being run inside a console and reading CONIN$ or writing to CONOUT$ without checking whether they can be opened. When you run it from Rterm, Rterm is in a console, which appears to be good enough. So it may be anyone who wants to use it will have to contact Microsoft to find out how... Duncan Murdoch
Uwe On 07.01.2010 12:25, Gabor Grothendieck wrote:
I get a problem with shell too: Under Rgui:
R.version.string
[1] "R version 2.10.1 Patched (2010-01-01 r50884)"
system("C:\\windows\\system32\\find /?", intern = TRUE)
character(0)
system("cmd /c C:\\windows\\system32\\find /?", intern = TRUE)
character(0)
shell("C:\\windows\\system32\\find /?")
Warning message:
In shell("C:\\windows\\system32\\find /?") :
'C:\windows\system32\find /?' execution failed with error code 1
They all work, i.e. they give the required help message, under Rterm
and when I issue this from the Windows console it works:
C:\windows\system32\find /?
2010/1/7 Uwe Ligges<ligges at statistik.tu-dortmund.de>:
On 07.01.2010 02:04, Gabor Grothendieck wrote:
If you have C:\Rtools\bin on your PATH note that it contains a UNIX-like find utility that conflicts with the find utility in Windows. If that is the problem then remove that from your PATH and then run the batch file. The batchfiles distribution at http://batchfiles.googlecode.com has utilities (Rgui.bat, R.bat, Rtools.bat, etc.) that will automatically add C:\Rtools\bin to your path temporarily or only while R is running so that you can leave it off your PATH.
I guess it's the use of system() rather than shell() that causes the problem. Under Windows, you have to use shell in order to start a command interpreter. Uwe Ligges
On Wed, Jan 6, 2010 at 6:51 PM, John Schexnayder<jschex at us.ibm.com> wrote:
This is sort of a strange bug. Not show stopping, but annoying. I
was
wondering if anyone else has noticed this and reported it before I
submit
a bug report.
I noticed while running the RGui and attempting to debug one of my
scripts
that I encountered a Windows error informing me that "Find String
[grep]
Utility has encountered a problem and needs to close." It is being
generated by a call to a DOS batch file which contains a call to
Find.exe.
It can be reproduced by simply typing "System("find")" in RGui.
What I
found strange is that I have been running this script daily without
this
problem for months. I now realize I never ran that portion of the
script
while in RGui.exe. It has always run in batch mode which is done by
Rterm.exe.
I have tried this on three separate machines now all running Windows
XP
SP3, with versions of R 2.8.1 and R 2.10.1 If executing
"System("find")
under RGui, an error window for the Find String Utility is generated
and
the command is not exectuted. If the same command is issued in Rterm
the
expected "FIND: Parameter format not correct" message is properly
returned.
It doesn't seem an important bug, but it could be the canary in the
mine
for a larger problem somewhere down the road.
Re,
John Schexnayder
IBM Tape Manufacturing - Information Technology
San Jose, CA 95138
JSchex at us.ibm.com
[[alternative HTML version deleted]]
______________________________________________ R-help at r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
______________________________________________ R-help at r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
______________________________________________ R-help at r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
I noticed this does work, i.e. it displays the requested help info, in
Rgui on my Vista system:
library(tcltk)
.Tcl("exec find /?")
On Sat, Jan 9, 2010 at 7:27 PM, Duncan Murdoch <murdoch at stats.uwo.ca> wrote:
On 09/01/2010 6:31 PM, Gabor Grothendieck wrote:
That doesn't explain why this returns character(o) even though we have
launched a console for it:
system("cmd /c C:\\windows\\system32\\find /?", intern = TRUE)
I don't see any console launched. ?R redirects stdin and stdout (and stderr,
I think), and it appears that Windows doesn't open a console. ?I do see a
console flash by if I do
system('cmd /c c:/WINDOWS/system32/find.exe /?', wait=FALSE,
invisible=FALSE)
but of course then we don't capture the output, so it's not very useful.
?Looking at the source, the only case where we ask to create a console is
the combination "wait=FALSE, invisible=FALSE", but there might be
combinations of other options that make this a default. ?The MS
documentation says that a console will be created automatically for any
console application, but that doesn't appear to be happening.
So I guess you could get find.exe to work by calling it from a batch file
with a "pause" at the end and using the wait=FALSE,invisible=FALSE options.
The above observations are in Win XP SP3, not anything newer.
Duncan Murdoch
On Sat, Jan 9, 2010 at 5:24 PM, Duncan Murdoch <murdoch at stats.uwo.ca> wrote:
On 07/01/2010 1:25 PM, Uwe Ligges wrote:
Argh. I see it as well. Will dig a lit tomorrow.
I don't know exactly what's going on, but it looks as though it is something specific to the find.exe utility, e.g. maybe it is assuming that it's being run inside a console and reading CONIN$ or writing to CONOUT$ without checking whether they can be opened. ?When you run it from Rterm, Rterm is in a console, which appears to be good enough. So it may be anyone who wants to use it will have to contact Microsoft to find out how... Duncan Murdoch
Uwe On 07.01.2010 12:25, Gabor Grothendieck wrote:
I get a problem with shell too: Under Rgui:
R.version.string
[1] "R version 2.10.1 Patched (2010-01-01 r50884)"
system("C:\\windows\\system32\\find /?", intern = TRUE)
character(0)
system("cmd /c C:\\windows\\system32\\find /?", intern = TRUE)
character(0)
shell("C:\\windows\\system32\\find /?")
Warning message:
In shell("C:\\windows\\system32\\find /?") :
?'C:\windows\system32\find /?' execution failed with error code 1
They all work, i.e. they give the required help message, under Rterm
and when I issue this from the Windows console it works:
C:\windows\system32\find /?
2010/1/7 Uwe Ligges<ligges at statistik.tu-dortmund.de>:
On 07.01.2010 02:04, Gabor Grothendieck wrote:
If you have C:\Rtools\bin on your PATH note that it contains a UNIX-like find utility that conflicts with the find utility in Windows. ?If that is the problem then remove that from your PATH and then run the batch file. The batchfiles distribution at http://batchfiles.googlecode.com ?has utilities (Rgui.bat, R.bat, Rtools.bat, etc.) that will automatically add C:\Rtools\bin to your path temporarily or only while R is running so that you can leave it off your PATH.
I guess it's the use of system() rather than shell() that causes the problem. Under Windows, you have to use shell in order to start a command interpreter. Uwe Ligges
On Wed, Jan 6, 2010 at 6:51 PM, John Schexnayder<jschex at us.ibm.com> ?wrote:
This is sort of a strange bug. ?Not show stopping, but annoying. ?I
was
wondering if anyone else has noticed this and reported it before I
submit
a bug report.
I noticed while running the RGui and attempting to debug one of my
scripts
that I encountered a Windows error informing me that "Find String
[grep]
Utility has encountered a problem and needs to close." ?It is being
generated by a call to a DOS batch file which contains a call to
Find.exe.
?It can be reproduced by simply typing ?"System("find")" in RGui.
?What I
found strange is that I have been running this script daily without
this
problem for months. ?I now realize I never ran that portion of the
script
while in RGui.exe. ?It has always run in batch mode which is done by
Rterm.exe.
I have tried this on three separate machines now all running Windows
XP
SP3, with versions of R 2.8.1 and R 2.10.1 ?If executing
"System("find")
under RGui, an error window for the Find String Utility is generated
and
the command is not exectuted. ?If the same command is issued in
Rterm
the
expected "FIND: Parameter format not correct" message is properly
returned.
It doesn't seem an important bug, but it could be the canary in the
mine
for a larger problem somewhere down the road.
Re,
John Schexnayder
IBM Tape Manufacturing - Information Technology
San Jose, CA ?95138
JSchex at us.ibm.com
? ? ? [[alternative HTML version deleted]]
______________________________________________ R-help at r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
______________________________________________ R-help at r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
______________________________________________ R-help at r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
Gabor Grothendieck wrote:
I noticed this does work, i.e. it displays the requested help info, in
Rgui on my Vista system:
library(tcltk)
.Tcl("exec find /?")
Yes, here too. It stores the output in a tclObj, so it's doing what we want to do. Anyone familiar with the Tcl source, and can spot the difference between their exec and our system()? Duncan Murdoch
On Sat, Jan 9, 2010 at 7:27 PM, Duncan Murdoch <murdoch at stats.uwo.ca> wrote:
On 09/01/2010 6:31 PM, Gabor Grothendieck wrote:
That doesn't explain why this returns character(o) even though we have
launched a console for it:
system("cmd /c C:\\windows\\system32\\find /?", intern = TRUE)
I don't see any console launched. R redirects stdin and stdout (and stderr,
I think), and it appears that Windows doesn't open a console. I do see a
console flash by if I do
system('cmd /c c:/WINDOWS/system32/find.exe /?', wait=FALSE,
invisible=FALSE)
but of course then we don't capture the output, so it's not very useful.
Looking at the source, the only case where we ask to create a console is
the combination "wait=FALSE, invisible=FALSE", but there might be
combinations of other options that make this a default. The MS
documentation says that a console will be created automatically for any
console application, but that doesn't appear to be happening.
So I guess you could get find.exe to work by calling it from a batch file
with a "pause" at the end and using the wait=FALSE,invisible=FALSE options.
The above observations are in Win XP SP3, not anything newer.
Duncan Murdoch
On Sat, Jan 9, 2010 at 5:24 PM, Duncan Murdoch <murdoch at stats.uwo.ca>
wrote:
On 07/01/2010 1:25 PM, Uwe Ligges wrote:
Argh. I see it as well. Will dig a lit tomorrow.
I don't know exactly what's going on, but it looks as though it is
something
specific to the find.exe utility, e.g. maybe it is assuming that it's
being
run inside a console and reading CONIN$ or writing to CONOUT$ without
checking whether they can be opened. When you run it from Rterm, Rterm
is
in a console, which appears to be good enough.
So it may be anyone who wants to use it will have to contact Microsoft to
find out how...
Duncan Murdoch
Uwe
On 07.01.2010 12:25, Gabor Grothendieck wrote:
I get a problem with shell too:
Under Rgui:
R.version.string
[1] "R version 2.10.1 Patched (2010-01-01 r50884)"
system("C:\\windows\\system32\\find /?", intern = TRUE)
character(0)
system("cmd /c C:\\windows\\system32\\find /?", intern = TRUE)
character(0)
shell("C:\\windows\\system32\\find /?")
Warning message:
In shell("C:\\windows\\system32\\find /?") :
'C:\windows\system32\find /?' execution failed with error code 1
They all work, i.e. they give the required help message, under Rterm
and when I issue this from the Windows console it works:
C:\windows\system32\find /?
2010/1/7 Uwe Ligges<ligges at statistik.tu-dortmund.de>:
On 07.01.2010 02:04, Gabor Grothendieck wrote:
If you have C:\Rtools\bin on your PATH note that it contains a UNIX-like find utility that conflicts with the find utility in Windows. If that is the problem then remove that from your PATH and then run the batch file. The batchfiles distribution at http://batchfiles.googlecode.com has utilities (Rgui.bat, R.bat, Rtools.bat, etc.) that will automatically add C:\Rtools\bin to your path temporarily or only while R is running so that you can leave it off your PATH.
I guess it's the use of system() rather than shell() that causes the
problem. Under Windows, you have to use shell in order to start a
command
interpreter.
Uwe Ligges
On Wed, Jan 6, 2010 at 6:51 PM, John Schexnayder<jschex at us.ibm.com>
wrote:
This is sort of a strange bug. Not show stopping, but annoying. I
was
wondering if anyone else has noticed this and reported it before I
submit
a bug report.
I noticed while running the RGui and attempting to debug one of my
scripts
that I encountered a Windows error informing me that "Find String
[grep]
Utility has encountered a problem and needs to close." It is being
generated by a call to a DOS batch file which contains a call to
Find.exe.
It can be reproduced by simply typing "System("find")" in RGui.
What I
found strange is that I have been running this script daily without
this
problem for months. I now realize I never ran that portion of the
script
while in RGui.exe. It has always run in batch mode which is done by
Rterm.exe.
I have tried this on three separate machines now all running Windows
XP
SP3, with versions of R 2.8.1 and R 2.10.1 If executing
"System("find")
under RGui, an error window for the Find String Utility is generated
and
the command is not exectuted. If the same command is issued in
Rterm
the
expected "FIND: Parameter format not correct" message is properly
returned.
It doesn't seem an important bug, but it could be the canary in the
mine
for a larger problem somewhere down the road.
Re,
John Schexnayder
IBM Tape Manufacturing - Information Technology
San Jose, CA 95138
JSchex at us.ibm.com
[[alternative HTML version deleted]]
______________________________________________ R-help at r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
______________________________________________ R-help at r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
______________________________________________ R-help at r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
______________________________________________ R-help at r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
Article ID: 106203 - Last Review: November 1, 2006 - Revision: 3.1 FIND.EXE Does Not Return the Proper Errorlevel in Windows NT http://support.microsoft.com/kb/106203 /Henrik
On Sun, Jan 10, 2010 at 5:39 AM, Duncan Murdoch <murdoch at stats.uwo.ca> wrote:
Gabor Grothendieck wrote:
I noticed this does work, i.e. it displays the requested help info, in
Rgui on my Vista system:
library(tcltk)
.Tcl("exec find /?")
Yes, here too. ?It stores the output in a tclObj, so it's doing what we want to do. ?Anyone familiar with the Tcl source, and can spot the difference between their exec and our system()? Duncan Murdoch
On Sat, Jan 9, 2010 at 7:27 PM, Duncan Murdoch <murdoch at stats.uwo.ca> wrote:
On 09/01/2010 6:31 PM, Gabor Grothendieck wrote:
That doesn't explain why this returns character(o) even though we have
launched a console for it:
system("cmd /c C:\\windows\\system32\\find /?", intern = TRUE)
I don't see any console launched. ?R redirects stdin and stdout (and
stderr,
I think), and it appears that Windows doesn't open a console. ?I do see a
console flash by if I do
system('cmd /c c:/WINDOWS/system32/find.exe /?', wait=FALSE,
invisible=FALSE)
but of course then we don't capture the output, so it's not very useful.
?Looking at the source, the only case where we ask to create a console is
the combination "wait=FALSE, invisible=FALSE", but there might be
combinations of other options that make this a default. ?The MS
documentation says that a console will be created automatically for any
console application, but that doesn't appear to be happening.
So I guess you could get find.exe to work by calling it from a batch file
with a "pause" at the end and using the wait=FALSE,invisible=FALSE
options.
The above observations are in Win XP SP3, not anything newer.
Duncan Murdoch
On Sat, Jan 9, 2010 at 5:24 PM, Duncan Murdoch <murdoch at stats.uwo.ca> wrote:
On 07/01/2010 1:25 PM, Uwe Ligges wrote:
Argh. I see it as well. Will dig a lit tomorrow.
I don't know exactly what's going on, but it looks as though it is something specific to the find.exe utility, e.g. maybe it is assuming that it's being run inside a console and reading CONIN$ or writing to CONOUT$ without checking whether they can be opened. ?When you run it from Rterm, Rterm is in a console, which appears to be good enough. So it may be anyone who wants to use it will have to contact Microsoft to find out how... Duncan Murdoch
Uwe On 07.01.2010 12:25, Gabor Grothendieck wrote:
I get a problem with shell too: Under Rgui:
R.version.string
[1] "R version 2.10.1 Patched (2010-01-01 r50884)"
system("C:\\windows\\system32\\find /?", intern = TRUE)
character(0)
system("cmd /c C:\\windows\\system32\\find /?", intern = TRUE)
character(0)
shell("C:\\windows\\system32\\find /?")
Warning message:
In shell("C:\\windows\\system32\\find /?") :
?'C:\windows\system32\find /?' execution failed with error code 1
They all work, i.e. they give the required help message, under Rterm
and when I issue this from the Windows console it works:
C:\windows\system32\find /?
2010/1/7 Uwe Ligges<ligges at statistik.tu-dortmund.de>:
On 07.01.2010 02:04, Gabor Grothendieck wrote:
If you have C:\Rtools\bin on your PATH note that it contains a UNIX-like find utility that conflicts with the find utility in Windows. ?If that is the problem then remove that from your PATH and then run the batch file. The batchfiles distribution at http://batchfiles.googlecode.com ?has utilities (Rgui.bat, R.bat, Rtools.bat, etc.) that will automatically add C:\Rtools\bin to your path temporarily or only while R is running so that you can leave it off your PATH.
I guess it's the use of system() rather than shell() that causes the problem. Under Windows, you have to use shell in order to start a command interpreter. Uwe Ligges
On Wed, Jan 6, 2010 at 6:51 PM, John Schexnayder<jschex at us.ibm.com> ?wrote:
This is sort of a strange bug. ?Not show stopping, but annoying.
?I
was
wondering if anyone else has noticed this and reported it before I
submit
a bug report.
I noticed while running the RGui and attempting to debug one of my
scripts
that I encountered a Windows error informing me that "Find String
[grep]
Utility has encountered a problem and needs to close." ?It is
being
generated by a call to a DOS batch file which contains a call to
Find.exe.
?It can be reproduced by simply typing ?"System("find")" in RGui.
?What I
found strange is that I have been running this script daily
without
this
problem for months. ?I now realize I never ran that portion of the
script
while in RGui.exe. ?It has always run in batch mode which is done
by
Rterm.exe.
I have tried this on three separate machines now all running
Windows
XP
SP3, with versions of R 2.8.1 and R 2.10.1 ?If executing
"System("find")
under RGui, an error window for the Find String Utility is
generated
and
the command is not exectuted. ?If the same command is issued in
Rterm
the
expected "FIND: Parameter format not correct" message is properly
returned.
It doesn't seem an important bug, but it could be the canary in
the
mine
for a larger problem somewhere down the road.
Re,
John Schexnayder
IBM Tape Manufacturing - Information Technology
San Jose, CA ?95138
JSchex at us.ibm.com
? ? ?[[alternative HTML version deleted]]
______________________________________________ R-help at r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
______________________________________________ R-help at r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
______________________________________________ R-help at r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
______________________________________________ R-help at r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
______________________________________________ R-help at r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
Forgot to say that when you use that findit.bat script, you get: Rgui.exe:
system("findit.bat")
Errorlevel is 1, not found
shell("findit.bat")
Errorlevel is 1, not found Rterm.exe:
shell("findit.bat")
c:\config.sys Errorlevel is 0, found
system("findit.bat")
c:\config.sys Errorlevel is 0, found Windows Vista Business SP2
sessionInfo()
R version 2.10.1 Patched (2010-01-01 r50884) i386-pc-mingw32 locale: [1] LC_COLLATE=English_United States.1252 [2] LC_CTYPE=English_United States.1252 [3] LC_MONETARY=English_United States.1252 [4] LC_NUMERIC=C [5] LC_TIME=English_United States.1252 attached base packages: [1] stats graphics grDevices utils datasets methods base loaded via a namespace (and not attached): [1] tools_2.10.1 /H 2010/1/10 hb <hb at stat.berkeley.edu>:
Article ID: 106203 - Last Review: November 1, 2006 - Revision: 3.1 FIND.EXE Does Not Return the Proper Errorlevel in Windows NT http://support.microsoft.com/kb/106203 /Henrik On Sun, Jan 10, 2010 at 5:39 AM, Duncan Murdoch <murdoch at stats.uwo.ca> wrote:
Gabor Grothendieck wrote:
I noticed this does work, i.e. it displays the requested help info, in
Rgui on my Vista system:
library(tcltk)
.Tcl("exec find /?")
Yes, here too. ?It stores the output in a tclObj, so it's doing what we want to do. ?Anyone familiar with the Tcl source, and can spot the difference between their exec and our system()? Duncan Murdoch
On Sat, Jan 9, 2010 at 7:27 PM, Duncan Murdoch <murdoch at stats.uwo.ca> wrote:
On 09/01/2010 6:31 PM, Gabor Grothendieck wrote:
That doesn't explain why this returns character(o) even though we have
launched a console for it:
system("cmd /c C:\\windows\\system32\\find /?", intern = TRUE)
I don't see any console launched. ?R redirects stdin and stdout (and
stderr,
I think), and it appears that Windows doesn't open a console. ?I do see a
console flash by if I do
system('cmd /c c:/WINDOWS/system32/find.exe /?', wait=FALSE,
invisible=FALSE)
but of course then we don't capture the output, so it's not very useful.
?Looking at the source, the only case where we ask to create a console is
the combination "wait=FALSE, invisible=FALSE", but there might be
combinations of other options that make this a default. ?The MS
documentation says that a console will be created automatically for any
console application, but that doesn't appear to be happening.
So I guess you could get find.exe to work by calling it from a batch file
with a "pause" at the end and using the wait=FALSE,invisible=FALSE
options.
The above observations are in Win XP SP3, not anything newer.
Duncan Murdoch
On Sat, Jan 9, 2010 at 5:24 PM, Duncan Murdoch <murdoch at stats.uwo.ca> wrote:
On 07/01/2010 1:25 PM, Uwe Ligges wrote:
Argh. I see it as well. Will dig a lit tomorrow.
I don't know exactly what's going on, but it looks as though it is something specific to the find.exe utility, e.g. maybe it is assuming that it's being run inside a console and reading CONIN$ or writing to CONOUT$ without checking whether they can be opened. ?When you run it from Rterm, Rterm is in a console, which appears to be good enough. So it may be anyone who wants to use it will have to contact Microsoft to find out how... Duncan Murdoch
Uwe On 07.01.2010 12:25, Gabor Grothendieck wrote:
I get a problem with shell too: Under Rgui:
R.version.string
[1] "R version 2.10.1 Patched (2010-01-01 r50884)"
system("C:\\windows\\system32\\find /?", intern = TRUE)
character(0)
system("cmd /c C:\\windows\\system32\\find /?", intern = TRUE)
character(0)
shell("C:\\windows\\system32\\find /?")
Warning message:
In shell("C:\\windows\\system32\\find /?") :
?'C:\windows\system32\find /?' execution failed with error code 1
They all work, i.e. they give the required help message, under Rterm
and when I issue this from the Windows console it works:
C:\windows\system32\find /?
2010/1/7 Uwe Ligges<ligges at statistik.tu-dortmund.de>:
On 07.01.2010 02:04, Gabor Grothendieck wrote:
If you have C:\Rtools\bin on your PATH note that it contains a UNIX-like find utility that conflicts with the find utility in Windows. ?If that is the problem then remove that from your PATH and then run the batch file. The batchfiles distribution at http://batchfiles.googlecode.com ?has utilities (Rgui.bat, R.bat, Rtools.bat, etc.) that will automatically add C:\Rtools\bin to your path temporarily or only while R is running so that you can leave it off your PATH.
I guess it's the use of system() rather than shell() that causes the problem. Under Windows, you have to use shell in order to start a command interpreter. Uwe Ligges
On Wed, Jan 6, 2010 at 6:51 PM, John Schexnayder<jschex at us.ibm.com> ?wrote:
This is sort of a strange bug. ?Not show stopping, but annoying.
?I
was
wondering if anyone else has noticed this and reported it before I
submit
a bug report.
I noticed while running the RGui and attempting to debug one of my
scripts
that I encountered a Windows error informing me that "Find String
[grep]
Utility has encountered a problem and needs to close." ?It is
being
generated by a call to a DOS batch file which contains a call to
Find.exe.
?It can be reproduced by simply typing ?"System("find")" in RGui.
?What I
found strange is that I have been running this script daily
without
this
problem for months. ?I now realize I never ran that portion of the
script
while in RGui.exe. ?It has always run in batch mode which is done
by
Rterm.exe.
I have tried this on three separate machines now all running
Windows
XP
SP3, with versions of R 2.8.1 and R 2.10.1 ?If executing
"System("find")
under RGui, an error window for the Find String Utility is
generated
and
the command is not exectuted. ?If the same command is issued in
Rterm
the
expected "FIND: Parameter format not correct" message is properly
returned.
It doesn't seem an important bug, but it could be the canary in
the
mine
for a larger problem somewhere down the road.
Re,
John Schexnayder
IBM Tape Manufacturing - Information Technology
San Jose, CA ?95138
JSchex at us.ibm.com
? ? ?[[alternative HTML version deleted]]
______________________________________________ R-help at r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
______________________________________________ R-help at r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
______________________________________________ R-help at r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
______________________________________________ R-help at r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
______________________________________________ R-help at r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
cat(file="foo.txt", "Hello world\n")
shell('find "Hello" < foo.txt')
Hello world
shell('find "Hello" < foo.txt', intern=TRUE)
[1] "Hello world"
shell('type foo.txt | find "Hello"')
Hello world
shell('type foo.txt | find "Hello"', intern=TRUE)
[1] "Hello world" A person at http://www.experts-exchange.com/Programming/Misc/Q_20857955.html give the hypotheses that the 'Errorlevel' returned is not from whether 'find.exe' was executed or not, but whether find finds the string or not. This is consistent with:
res <- shell('find "Hello" < foo.txt');
Hello world
res
[1] 0
res <- shell('find "Hellor" < foo.txt');
Warning message:
In shell("find \"Hellor\" < foo.txt") :
'find "Hellor" < foo.txt' execution failed with error code 1
res
[1] 1 I still don't understand their argument why you have to redirect/pipe in the foo.txt file for it to work;
shell('find "Hello" foo.txt')
Warning message:
In shell("find \"Hello\" foo.txt") :
'find "Hello" foo.txt' execution failed with error code 1
shell('find "Hello" foo.txt', intern=TRUE)
character(0) /Henrik 2010/1/10 hb <hb at stat.berkeley.edu>:
Forgot to say that when you use that findit.bat script, you get: Rgui.exe:
system("findit.bat")
Errorlevel is 1, not found
shell("findit.bat")
Errorlevel is 1, not found Rterm.exe:
shell("findit.bat")
c:\config.sys Errorlevel is 0, found
system("findit.bat")
c:\config.sys Errorlevel is 0, found Windows Vista Business SP2
sessionInfo()
R version 2.10.1 Patched (2010-01-01 r50884) i386-pc-mingw32 locale: [1] LC_COLLATE=English_United States.1252 [2] LC_CTYPE=English_United States.1252 [3] LC_MONETARY=English_United States.1252 [4] LC_NUMERIC=C [5] LC_TIME=English_United States.1252 attached base packages: [1] stats graphics grDevices utils datasets methods base loaded via a namespace (and not attached): [1] tools_2.10.1 /H 2010/1/10 hb <hb at stat.berkeley.edu>:
Article ID: 106203 - Last Review: November 1, 2006 - Revision: 3.1 FIND.EXE Does Not Return the Proper Errorlevel in Windows NT http://support.microsoft.com/kb/106203 /Henrik On Sun, Jan 10, 2010 at 5:39 AM, Duncan Murdoch <murdoch at stats.uwo.ca> wrote:
Gabor Grothendieck wrote:
I noticed this does work, i.e. it displays the requested help info, in
Rgui on my Vista system:
library(tcltk)
.Tcl("exec find /?")
Yes, here too. ?It stores the output in a tclObj, so it's doing what we want to do. ?Anyone familiar with the Tcl source, and can spot the difference between their exec and our system()? Duncan Murdoch
On Sat, Jan 9, 2010 at 7:27 PM, Duncan Murdoch <murdoch at stats.uwo.ca> wrote:
On 09/01/2010 6:31 PM, Gabor Grothendieck wrote:
That doesn't explain why this returns character(o) even though we have
launched a console for it:
system("cmd /c C:\\windows\\system32\\find /?", intern = TRUE)
I don't see any console launched. ?R redirects stdin and stdout (and
stderr,
I think), and it appears that Windows doesn't open a console. ?I do see a
console flash by if I do
system('cmd /c c:/WINDOWS/system32/find.exe /?', wait=FALSE,
invisible=FALSE)
but of course then we don't capture the output, so it's not very useful.
?Looking at the source, the only case where we ask to create a console is
the combination "wait=FALSE, invisible=FALSE", but there might be
combinations of other options that make this a default. ?The MS
documentation says that a console will be created automatically for any
console application, but that doesn't appear to be happening.
So I guess you could get find.exe to work by calling it from a batch file
with a "pause" at the end and using the wait=FALSE,invisible=FALSE
options.
The above observations are in Win XP SP3, not anything newer.
Duncan Murdoch
On Sat, Jan 9, 2010 at 5:24 PM, Duncan Murdoch <murdoch at stats.uwo.ca> wrote:
On 07/01/2010 1:25 PM, Uwe Ligges wrote:
Argh. I see it as well. Will dig a lit tomorrow.
I don't know exactly what's going on, but it looks as though it is something specific to the find.exe utility, e.g. maybe it is assuming that it's being run inside a console and reading CONIN$ or writing to CONOUT$ without checking whether they can be opened. ?When you run it from Rterm, Rterm is in a console, which appears to be good enough. So it may be anyone who wants to use it will have to contact Microsoft to find out how... Duncan Murdoch
Uwe On 07.01.2010 12:25, Gabor Grothendieck wrote:
I get a problem with shell too: Under Rgui:
R.version.string
[1] "R version 2.10.1 Patched (2010-01-01 r50884)"
system("C:\\windows\\system32\\find /?", intern = TRUE)
character(0)
system("cmd /c C:\\windows\\system32\\find /?", intern = TRUE)
character(0)
shell("C:\\windows\\system32\\find /?")
Warning message:
In shell("C:\\windows\\system32\\find /?") :
?'C:\windows\system32\find /?' execution failed with error code 1
They all work, i.e. they give the required help message, under Rterm
and when I issue this from the Windows console it works:
C:\windows\system32\find /?
2010/1/7 Uwe Ligges<ligges at statistik.tu-dortmund.de>:
On 07.01.2010 02:04, Gabor Grothendieck wrote:
If you have C:\Rtools\bin on your PATH note that it contains a UNIX-like find utility that conflicts with the find utility in Windows. ?If that is the problem then remove that from your PATH and then run the batch file. The batchfiles distribution at http://batchfiles.googlecode.com ?has utilities (Rgui.bat, R.bat, Rtools.bat, etc.) that will automatically add C:\Rtools\bin to your path temporarily or only while R is running so that you can leave it off your PATH.
I guess it's the use of system() rather than shell() that causes the problem. Under Windows, you have to use shell in order to start a command interpreter. Uwe Ligges
On Wed, Jan 6, 2010 at 6:51 PM, John Schexnayder<jschex at us.ibm.com> ?wrote:
This is sort of a strange bug. ?Not show stopping, but annoying.
?I
was
wondering if anyone else has noticed this and reported it before I
submit
a bug report.
I noticed while running the RGui and attempting to debug one of my
scripts
that I encountered a Windows error informing me that "Find String
[grep]
Utility has encountered a problem and needs to close." ?It is
being
generated by a call to a DOS batch file which contains a call to
Find.exe.
?It can be reproduced by simply typing ?"System("find")" in RGui.
?What I
found strange is that I have been running this script daily
without
this
problem for months. ?I now realize I never ran that portion of the
script
while in RGui.exe. ?It has always run in batch mode which is done
by
Rterm.exe.
I have tried this on three separate machines now all running
Windows
XP
SP3, with versions of R 2.8.1 and R 2.10.1 ?If executing
"System("find")
under RGui, an error window for the Find String Utility is
generated
and
the command is not exectuted. ?If the same command is issued in
Rterm
the
expected "FIND: Parameter format not correct" message is properly
returned.
It doesn't seem an important bug, but it could be the canary in
the
mine
for a larger problem somewhere down the road.
Re,
John Schexnayder
IBM Tape Manufacturing - Information Technology
San Jose, CA ?95138
JSchex at us.ibm.com
? ? ?[[alternative HTML version deleted]]
______________________________________________ R-help at r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
______________________________________________ R-help at r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
______________________________________________ R-help at r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
______________________________________________ R-help at r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
______________________________________________ R-help at r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
I'm quitting on this one. For the record, I took a look at a fairly old
version of the Tcl code (from 8.4.13) that I had around from an old
attempt to get it to work properly with MDI windows. There are a number
of differences between their exec code and our system() code, but I
couldn't find the right combination to get system() to be able to run
find. It always crashes with a seg fault in ulib.dll when run with
input coming from the pipe we send it.
If you use input redirection on the command line, it's fine, for example
system("cmd /c c:/WINDOWS/system32/find /? <nul")
or
shell("c:/WINDOWS/system32/find \"Hello\" c:/temp/foo.txt <nul")
So perhaps we're not setting up the pipe correctly, but it works with
most other programs, so I'm going to assume find is using it
incorrectly, unless someone points out what we're doing wrong.
Duncan Murdoch
On 10/01/2010 8:18 AM, Gabor Grothendieck wrote:
I noticed this does work, i.e. it displays the requested help info, in
Rgui on my Vista system:
library(tcltk)
.Tcl("exec find /?")
On Sat, Jan 9, 2010 at 7:27 PM, Duncan Murdoch <murdoch at stats.uwo.ca> wrote:
On 09/01/2010 6:31 PM, Gabor Grothendieck wrote:
That doesn't explain why this returns character(o) even though we have
launched a console for it:
system("cmd /c C:\\windows\\system32\\find /?", intern = TRUE)
I don't see any console launched. R redirects stdin and stdout (and stderr,
I think), and it appears that Windows doesn't open a console. I do see a
console flash by if I do
system('cmd /c c:/WINDOWS/system32/find.exe /?', wait=FALSE,
invisible=FALSE)
but of course then we don't capture the output, so it's not very useful.
Looking at the source, the only case where we ask to create a console is
the combination "wait=FALSE, invisible=FALSE", but there might be
combinations of other options that make this a default. The MS
documentation says that a console will be created automatically for any
console application, but that doesn't appear to be happening.
So I guess you could get find.exe to work by calling it from a batch file
with a "pause" at the end and using the wait=FALSE,invisible=FALSE options.
The above observations are in Win XP SP3, not anything newer.
Duncan Murdoch
On Sat, Jan 9, 2010 at 5:24 PM, Duncan Murdoch <murdoch at stats.uwo.ca> wrote:
On 07/01/2010 1:25 PM, Uwe Ligges wrote:
Argh. I see it as well. Will dig a lit tomorrow.
I don't know exactly what's going on, but it looks as though it is something specific to the find.exe utility, e.g. maybe it is assuming that it's being run inside a console and reading CONIN$ or writing to CONOUT$ without checking whether they can be opened. When you run it from Rterm, Rterm is in a console, which appears to be good enough. So it may be anyone who wants to use it will have to contact Microsoft to find out how... Duncan Murdoch
Uwe On 07.01.2010 12:25, Gabor Grothendieck wrote:
I get a problem with shell too: Under Rgui:
R.version.string
[1] "R version 2.10.1 Patched (2010-01-01 r50884)"
system("C:\\windows\\system32\\find /?", intern = TRUE)
character(0)
system("cmd /c C:\\windows\\system32\\find /?", intern = TRUE)
character(0)
shell("C:\\windows\\system32\\find /?")
Warning message:
In shell("C:\\windows\\system32\\find /?") :
'C:\windows\system32\find /?' execution failed with error code 1
They all work, i.e. they give the required help message, under Rterm
and when I issue this from the Windows console it works:
C:\windows\system32\find /?
2010/1/7 Uwe Ligges<ligges at statistik.tu-dortmund.de>:
On 07.01.2010 02:04, Gabor Grothendieck wrote:
If you have C:\Rtools\bin on your PATH note that it contains a UNIX-like find utility that conflicts with the find utility in Windows. If that is the problem then remove that from your PATH and then run the batch file. The batchfiles distribution at http://batchfiles.googlecode.com has utilities (Rgui.bat, R.bat, Rtools.bat, etc.) that will automatically add C:\Rtools\bin to your path temporarily or only while R is running so that you can leave it off your PATH.
I guess it's the use of system() rather than shell() that causes the problem. Under Windows, you have to use shell in order to start a command interpreter. Uwe Ligges
On Wed, Jan 6, 2010 at 6:51 PM, John Schexnayder<jschex at us.ibm.com> wrote:
This is sort of a strange bug. Not show stopping, but annoying. I
was
wondering if anyone else has noticed this and reported it before I
submit
a bug report.
I noticed while running the RGui and attempting to debug one of my
scripts
that I encountered a Windows error informing me that "Find String
[grep]
Utility has encountered a problem and needs to close." It is being
generated by a call to a DOS batch file which contains a call to
Find.exe.
It can be reproduced by simply typing "System("find")" in RGui.
What I
found strange is that I have been running this script daily without
this
problem for months. I now realize I never ran that portion of the
script
while in RGui.exe. It has always run in batch mode which is done by
Rterm.exe.
I have tried this on three separate machines now all running Windows
XP
SP3, with versions of R 2.8.1 and R 2.10.1 If executing
"System("find")
under RGui, an error window for the Find String Utility is generated
and
the command is not exectuted. If the same command is issued in
Rterm
the
expected "FIND: Parameter format not correct" message is properly
returned.
It doesn't seem an important bug, but it could be the canary in the
mine
for a larger problem somewhere down the road.
Re,
John Schexnayder
IBM Tape Manufacturing - Information Technology
San Jose, CA 95138
JSchex at us.ibm.com
[[alternative HTML version deleted]]
______________________________________________ R-help at r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
______________________________________________ R-help at r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
______________________________________________ R-help at r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
Perhaps you can add it to the bug list before you leave it including what you tried in case its a symptom of some larger underlying problem.
On Sun, Jan 10, 2010 at 1:24 PM, Duncan Murdoch <murdoch at stats.uwo.ca> wrote:
I'm quitting on this one. ?For the record, I took a look at a fairly old
version of the Tcl code (from 8.4.13) that I had around from an old attempt
to get it to work properly with MDI windows. ?There are a number of
differences between their exec code and our system() code, but I couldn't
find the right combination to get system() to be able to run find. ?It
always crashes with a seg fault in ulib.dll when run with input coming from
the pipe we send it.
If you use input redirection on the command line, it's fine, for example
system("cmd /c c:/WINDOWS/system32/find /? <nul")
or
shell("c:/WINDOWS/system32/find \"Hello\" c:/temp/foo.txt <nul")
So perhaps we're not setting up the pipe correctly, but it works with most
other programs, so I'm going to assume find is using it incorrectly, unless
someone points out what we're doing wrong.
Duncan Murdoch
On 10/01/2010 8:18 AM, Gabor Grothendieck wrote:
I noticed this does work, i.e. it displays the requested help info, in
Rgui on my Vista system:
library(tcltk)
.Tcl("exec find /?")
On Sat, Jan 9, 2010 at 7:27 PM, Duncan Murdoch <murdoch at stats.uwo.ca>
wrote:
On 09/01/2010 6:31 PM, Gabor Grothendieck wrote:
That doesn't explain why this returns character(o) even though we have
launched a console for it:
system("cmd /c C:\\windows\\system32\\find /?", intern = TRUE)
I don't see any console launched. ?R redirects stdin and stdout (and
stderr,
I think), and it appears that Windows doesn't open a console. ?I do see a
console flash by if I do
system('cmd /c c:/WINDOWS/system32/find.exe /?', wait=FALSE,
invisible=FALSE)
but of course then we don't capture the output, so it's not very useful.
?Looking at the source, the only case where we ask to create a console is
the combination "wait=FALSE, invisible=FALSE", but there might be
combinations of other options that make this a default. ?The MS
documentation says that a console will be created automatically for any
console application, but that doesn't appear to be happening.
So I guess you could get find.exe to work by calling it from a batch file
with a "pause" at the end and using the wait=FALSE,invisible=FALSE
options.
The above observations are in Win XP SP3, not anything newer.
Duncan Murdoch
On Sat, Jan 9, 2010 at 5:24 PM, Duncan Murdoch <murdoch at stats.uwo.ca> wrote:
On 07/01/2010 1:25 PM, Uwe Ligges wrote:
Argh. I see it as well. Will dig a lit tomorrow.
I don't know exactly what's going on, but it looks as though it is something specific to the find.exe utility, e.g. maybe it is assuming that it's being run inside a console and reading CONIN$ or writing to CONOUT$ without checking whether they can be opened. ?When you run it from Rterm, Rterm is in a console, which appears to be good enough. So it may be anyone who wants to use it will have to contact Microsoft to find out how... Duncan Murdoch
Uwe On 07.01.2010 12:25, Gabor Grothendieck wrote:
I get a problem with shell too: Under Rgui:
R.version.string
[1] "R version 2.10.1 Patched (2010-01-01 r50884)"
system("C:\\windows\\system32\\find /?", intern = TRUE)
character(0)
system("cmd /c C:\\windows\\system32\\find /?", intern = TRUE)
character(0)
shell("C:\\windows\\system32\\find /?")
Warning message:
In shell("C:\\windows\\system32\\find /?") :
?'C:\windows\system32\find /?' execution failed with error code 1
They all work, i.e. they give the required help message, under Rterm
and when I issue this from the Windows console it works:
C:\windows\system32\find /?
2010/1/7 Uwe Ligges<ligges at statistik.tu-dortmund.de>:
On 07.01.2010 02:04, Gabor Grothendieck wrote:
If you have C:\Rtools\bin on your PATH note that it contains a UNIX-like find utility that conflicts with the find utility in Windows. ?If that is the problem then remove that from your PATH and then run the batch file. The batchfiles distribution at http://batchfiles.googlecode.com ?has utilities (Rgui.bat, R.bat, Rtools.bat, etc.) that will automatically add C:\Rtools\bin to your path temporarily or only while R is running so that you can leave it off your PATH.
I guess it's the use of system() rather than shell() that causes the problem. Under Windows, you have to use shell in order to start a command interpreter. Uwe Ligges
On Wed, Jan 6, 2010 at 6:51 PM, John Schexnayder<jschex at us.ibm.com> ?wrote:
This is sort of a strange bug. ?Not show stopping, but annoying.
?I
was
wondering if anyone else has noticed this and reported it before I
submit
a bug report.
I noticed while running the RGui and attempting to debug one of my
scripts
that I encountered a Windows error informing me that "Find String
[grep]
Utility has encountered a problem and needs to close." ?It is
being
generated by a call to a DOS batch file which contains a call to
Find.exe.
?It can be reproduced by simply typing ?"System("find")" in RGui.
?What I
found strange is that I have been running this script daily
without
this
problem for months. ?I now realize I never ran that portion of the
script
while in RGui.exe. ?It has always run in batch mode which is done
by
Rterm.exe.
I have tried this on three separate machines now all running
Windows
XP
SP3, with versions of R 2.8.1 and R 2.10.1 ?If executing
"System("find")
under RGui, an error window for the Find String Utility is
generated
and
the command is not exectuted. ?If the same command is issued in
Rterm
the
expected "FIND: Parameter format not correct" message is properly
returned.
It doesn't seem an important bug, but it could be the canary in
the
mine
for a larger problem somewhere down the road.
Re,
John Schexnayder
IBM Tape Manufacturing - Information Technology
San Jose, CA ?95138
JSchex at us.ibm.com
? ? ?[[alternative HTML version deleted]]
______________________________________________ R-help at r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
______________________________________________ R-help at r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
______________________________________________ R-help at r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
On 10/01/2010 1:42 PM, Gabor Grothendieck wrote:
Perhaps you can add it to the bug list before you leave it including what you tried in case its a symptom of some larger underlying problem.
This list is archived, so there's a record. But I think this is a find bug, not an R bug, so it doesn't make sense to add it to the R bug list. Duncan Murdoch
On Sun, Jan 10, 2010 at 1:24 PM, Duncan Murdoch <murdoch at stats.uwo.ca> wrote:
I'm quitting on this one. For the record, I took a look at a fairly old
version of the Tcl code (from 8.4.13) that I had around from an old attempt
to get it to work properly with MDI windows. There are a number of
differences between their exec code and our system() code, but I couldn't
find the right combination to get system() to be able to run find. It
always crashes with a seg fault in ulib.dll when run with input coming from
the pipe we send it.
If you use input redirection on the command line, it's fine, for example
system("cmd /c c:/WINDOWS/system32/find /? <nul")
or
shell("c:/WINDOWS/system32/find \"Hello\" c:/temp/foo.txt <nul")
So perhaps we're not setting up the pipe correctly, but it works with most
other programs, so I'm going to assume find is using it incorrectly, unless
someone points out what we're doing wrong.
Duncan Murdoch
On 10/01/2010 8:18 AM, Gabor Grothendieck wrote:
I noticed this does work, i.e. it displays the requested help info, in
Rgui on my Vista system:
library(tcltk)
.Tcl("exec find /?")
On Sat, Jan 9, 2010 at 7:27 PM, Duncan Murdoch <murdoch at stats.uwo.ca>
wrote:
On 09/01/2010 6:31 PM, Gabor Grothendieck wrote:
That doesn't explain why this returns character(o) even though we have
launched a console for it:
system("cmd /c C:\\windows\\system32\\find /?", intern = TRUE)
I don't see any console launched. R redirects stdin and stdout (and
stderr,
I think), and it appears that Windows doesn't open a console. I do see a
console flash by if I do
system('cmd /c c:/WINDOWS/system32/find.exe /?', wait=FALSE,
invisible=FALSE)
but of course then we don't capture the output, so it's not very useful.
Looking at the source, the only case where we ask to create a console is
the combination "wait=FALSE, invisible=FALSE", but there might be
combinations of other options that make this a default. The MS
documentation says that a console will be created automatically for any
console application, but that doesn't appear to be happening.
So I guess you could get find.exe to work by calling it from a batch file
with a "pause" at the end and using the wait=FALSE,invisible=FALSE
options.
The above observations are in Win XP SP3, not anything newer.
Duncan Murdoch
On Sat, Jan 9, 2010 at 5:24 PM, Duncan Murdoch <murdoch at stats.uwo.ca> wrote:
On 07/01/2010 1:25 PM, Uwe Ligges wrote:
Argh. I see it as well. Will dig a lit tomorrow.
I don't know exactly what's going on, but it looks as though it is something specific to the find.exe utility, e.g. maybe it is assuming that it's being run inside a console and reading CONIN$ or writing to CONOUT$ without checking whether they can be opened. When you run it from Rterm, Rterm is in a console, which appears to be good enough. So it may be anyone who wants to use it will have to contact Microsoft to find out how... Duncan Murdoch
Uwe On 07.01.2010 12:25, Gabor Grothendieck wrote:
I get a problem with shell too: Under Rgui:
R.version.string
[1] "R version 2.10.1 Patched (2010-01-01 r50884)"
system("C:\\windows\\system32\\find /?", intern = TRUE)
character(0)
system("cmd /c C:\\windows\\system32\\find /?", intern = TRUE)
character(0)
shell("C:\\windows\\system32\\find /?")
Warning message:
In shell("C:\\windows\\system32\\find /?") :
'C:\windows\system32\find /?' execution failed with error code 1
They all work, i.e. they give the required help message, under Rterm
and when I issue this from the Windows console it works:
C:\windows\system32\find /?
2010/1/7 Uwe Ligges<ligges at statistik.tu-dortmund.de>:
On 07.01.2010 02:04, Gabor Grothendieck wrote:
If you have C:\Rtools\bin on your PATH note that it contains a UNIX-like find utility that conflicts with the find utility in Windows. If that is the problem then remove that from your PATH and then run the batch file. The batchfiles distribution at http://batchfiles.googlecode.com has utilities (Rgui.bat, R.bat, Rtools.bat, etc.) that will automatically add C:\Rtools\bin to your path temporarily or only while R is running so that you can leave it off your PATH.
I guess it's the use of system() rather than shell() that causes the problem. Under Windows, you have to use shell in order to start a command interpreter. Uwe Ligges
On Wed, Jan 6, 2010 at 6:51 PM, John Schexnayder<jschex at us.ibm.com> wrote:
This is sort of a strange bug. Not show stopping, but annoying.
I
was
wondering if anyone else has noticed this and reported it before I
submit
a bug report.
I noticed while running the RGui and attempting to debug one of my
scripts
that I encountered a Windows error informing me that "Find String
[grep]
Utility has encountered a problem and needs to close." It is
being
generated by a call to a DOS batch file which contains a call to
Find.exe.
It can be reproduced by simply typing "System("find")" in RGui.
What I
found strange is that I have been running this script daily
without
this
problem for months. I now realize I never ran that portion of the
script
while in RGui.exe. It has always run in batch mode which is done
by
Rterm.exe.
I have tried this on three separate machines now all running
Windows
XP
SP3, with versions of R 2.8.1 and R 2.10.1 If executing
"System("find")
under RGui, an error window for the Find String Utility is
generated
and
the command is not exectuted. If the same command is issued in
Rterm
the
expected "FIND: Parameter format not correct" message is properly
returned.
It doesn't seem an important bug, but it could be the canary in
the
mine
for a larger problem somewhere down the road.
Re,
John Schexnayder
IBM Tape Manufacturing - Information Technology
San Jose, CA 95138
JSchex at us.ibm.com
[[alternative HTML version deleted]]
______________________________________________ R-help at r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
______________________________________________ R-help at r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
______________________________________________ R-help at r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
That may be but given that tcl does not have the same problem it might still be something that would be desirable to address and it is possible that it is a symptom of a larger problem in R. It will more likely be lost if its buried in this discussion.
On Sun, Jan 10, 2010 at 1:51 PM, Duncan Murdoch <murdoch at stats.uwo.ca> wrote:
On 10/01/2010 1:42 PM, Gabor Grothendieck wrote:
Perhaps you can add it to the bug list before you leave it including what you tried in case its a symptom of some larger underlying problem.
This list is archived, so there's a record. ?But I think this is a find bug, not an R bug, so it doesn't make sense to add it to the R bug list. Duncan Murdoch
On Sun, Jan 10, 2010 at 1:24 PM, Duncan Murdoch <murdoch at stats.uwo.ca> wrote:
I'm quitting on this one. ?For the record, I took a look at a fairly old
version of the Tcl code (from 8.4.13) that I had around from an old
attempt
to get it to work properly with MDI windows. ?There are a number of
differences between their exec code and our system() code, but I couldn't
find the right combination to get system() to be able to run find. ?It
always crashes with a seg fault in ulib.dll when run with input coming
from
the pipe we send it.
If you use input redirection on the command line, it's fine, for example
system("cmd /c c:/WINDOWS/system32/find /? <nul")
or
shell("c:/WINDOWS/system32/find \"Hello\" c:/temp/foo.txt <nul")
So perhaps we're not setting up the pipe correctly, but it works with
most
other programs, so I'm going to assume find is using it incorrectly,
unless
someone points out what we're doing wrong.
Duncan Murdoch
On 10/01/2010 8:18 AM, Gabor Grothendieck wrote:
I noticed this does work, i.e. it displays the requested help info, in
Rgui on my Vista system:
library(tcltk)
.Tcl("exec find /?")
On Sat, Jan 9, 2010 at 7:27 PM, Duncan Murdoch <murdoch at stats.uwo.ca>
wrote:
On 09/01/2010 6:31 PM, Gabor Grothendieck wrote:
That doesn't explain why this returns character(o) even though we have
launched a console for it:
system("cmd /c C:\\windows\\system32\\find /?", intern = TRUE)
I don't see any console launched. ?R redirects stdin and stdout (and
stderr,
I think), and it appears that Windows doesn't open a console. ?I do see
a
console flash by if I do
system('cmd /c c:/WINDOWS/system32/find.exe /?', wait=FALSE,
invisible=FALSE)
but of course then we don't capture the output, so it's not very
useful.
?Looking at the source, the only case where we ask to create a console
is
the combination "wait=FALSE, invisible=FALSE", but there might be
combinations of other options that make this a default. ?The MS
documentation says that a console will be created automatically for any
console application, but that doesn't appear to be happening.
So I guess you could get find.exe to work by calling it from a batch
file
with a "pause" at the end and using the wait=FALSE,invisible=FALSE
options.
The above observations are in Win XP SP3, not anything newer.
Duncan Murdoch
On Sat, Jan 9, 2010 at 5:24 PM, Duncan Murdoch <murdoch at stats.uwo.ca> wrote:
On 07/01/2010 1:25 PM, Uwe Ligges wrote:
Argh. I see it as well. Will dig a lit tomorrow.
I don't know exactly what's going on, but it looks as though it is something specific to the find.exe utility, e.g. maybe it is assuming that it's being run inside a console and reading CONIN$ or writing to CONOUT$ without checking whether they can be opened. ?When you run it from Rterm, Rterm is in a console, which appears to be good enough. So it may be anyone who wants to use it will have to contact Microsoft to find out how... Duncan Murdoch
Uwe On 07.01.2010 12:25, Gabor Grothendieck wrote:
I get a problem with shell too: Under Rgui:
R.version.string
[1] "R version 2.10.1 Patched (2010-01-01 r50884)"
system("C:\\windows\\system32\\find /?", intern = TRUE)
character(0)
system("cmd /c C:\\windows\\system32\\find /?", intern = TRUE)
character(0)
shell("C:\\windows\\system32\\find /?")
Warning message:
In shell("C:\\windows\\system32\\find /?") :
?'C:\windows\system32\find /?' execution failed with error code 1
They all work, i.e. they give the required help message, under
Rterm
and when I issue this from the Windows console it works:
C:\windows\system32\find /?
2010/1/7 Uwe Ligges<ligges at statistik.tu-dortmund.de>:
On 07.01.2010 02:04, Gabor Grothendieck wrote:
If you have C:\Rtools\bin on your PATH note that it contains a UNIX-like find utility that conflicts with the find utility in Windows. ?If that is the problem then remove that from your PATH and then run the batch file. The batchfiles distribution at http://batchfiles.googlecode.com ?has utilities (Rgui.bat, R.bat, Rtools.bat, etc.) that will automatically add C:\Rtools\bin to your path temporarily or only while R is running so that you can leave it off your PATH.
I guess it's the use of system() rather than shell() that causes the problem. Under Windows, you have to use shell in order to start a command interpreter. Uwe Ligges
On Wed, Jan 6, 2010 at 6:51 PM, John Schexnayder<jschex at us.ibm.com> ?wrote:
This is sort of a strange bug. ?Not show stopping, but annoying.
?I
was
wondering if anyone else has noticed this and reported it before
I
submit
a bug report.
I noticed while running the RGui and attempting to debug one of
my
scripts
that I encountered a Windows error informing me that "Find
String
[grep]
Utility has encountered a problem and needs to close." ?It is
being
generated by a call to a DOS batch file which contains a call to
Find.exe.
?It can be reproduced by simply typing ?"System("find")" in
RGui.
?What I
found strange is that I have been running this script daily
without
this
problem for months. ?I now realize I never ran that portion of
the
script
while in RGui.exe. ?It has always run in batch mode which is
done
by
Rterm.exe.
I have tried this on three separate machines now all running
Windows
XP
SP3, with versions of R 2.8.1 and R 2.10.1 ?If executing
"System("find")
under RGui, an error window for the Find String Utility is
generated
and
the command is not exectuted. ?If the same command is issued in
Rterm
the
expected "FIND: Parameter format not correct" message is
properly
returned.
It doesn't seem an important bug, but it could be the canary in
the
mine
for a larger problem somewhere down the road.
Re,
John Schexnayder
IBM Tape Manufacturing - Information Technology
San Jose, CA ?95138
JSchex at us.ibm.com
? ? [[alternative HTML version deleted]]
______________________________________________ R-help at r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
______________________________________________ R-help at r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
______________________________________________ R-help at r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
1 day later
An embedded and charset-unspecified text was scrubbed... Name: not available URL: <https://stat.ethz.ch/pipermail/r-help/attachments/20100111/5535458a/attachment.pl>
On 11/01/2010 2:56 PM, John Schexnayder wrote:
I just wanted to add that it is not only caused by the FIND.EXE, but I
also noticed the same problem with DOSKEY.EXE. It too causes the same
fault, but the redirection (<nul) prevents the fault just like Duncan
pointed out with FIND. I imagine there are number of other executables
that would produce the same results. Oddly enough FINDSTR.EXE does not
produce the fault. (You would think it would share code with FIND.EXE.)
I also noticed other strange differences now that I poke around with other
executables. For instance
shell("copy /?")
produces the desired help information in RGui.exe however
shell("xcopy /?")
does not. I know they are different in that copy is not an executable,
but a system call where Xcopy is an executable, but they should behave the
same way.
Especially considering they do behave properly in Rterm. Again this is an
RGui only phenomena.
I don't find it very surprising. cmd.exe doesn't have the bug, so "copy /?" works fine. find.exe and apparently xcopy.exe do, so they fail. It's not a bug in doskey that it doesn't work; it's supposed to talk to the console, so if there is no console, it won't work. But find and xcopy have no business talking to the console. They should simply work with stdin/stdout. Duncan Murdoch
Re, John Schexnayder IBM Tape Manufacturing - Information Technology San Jose, CA 95138 JSchex at us.ibm.com From: Gabor Grothendieck <ggrothendieck at gmail.com> To: Duncan Murdoch <murdoch at stats.uwo.ca> Cc: Uwe Ligges <ligges at statistik.tu-dortmund.de>, John Schexnayder/San Jose/IBM at IBMUS, r-help at stat.math.ethz.ch Date: 01/10/2010 10:42 AM Subject: Re: [R] Calling FING.EXE under RGui.EXE for windows. Perhaps you can add it to the bug list before you leave it including what you tried in case its a symptom of some larger underlying problem. On Sun, Jan 10, 2010 at 1:24 PM, Duncan Murdoch <murdoch at stats.uwo.ca> wrote:
I'm quitting on this one. For the record, I took a look at a fairly old version of the Tcl code (from 8.4.13) that I had around from an old
attempt
to get it to work properly with MDI windows. There are a number of differences between their exec code and our system() code, but I
couldn't
find the right combination to get system() to be able to run find. It always crashes with a seg fault in ulib.dll when run with input coming
from
the pipe we send it.
If you use input redirection on the command line, it's fine, for example
system("cmd /c c:/WINDOWS/system32/find /? <nul")
or
shell("c:/WINDOWS/system32/find \"Hello\" c:/temp/foo.txt <nul")
So perhaps we're not setting up the pipe correctly, but it works with
most
other programs, so I'm going to assume find is using it incorrectly,
unless
someone points out what we're doing wrong. Duncan Murdoch On 10/01/2010 8:18 AM, Gabor Grothendieck wrote:
I noticed this does work, i.e. it displays the requested help info, in
Rgui on my Vista system:
library(tcltk)
.Tcl("exec find /?")
On Sat, Jan 9, 2010 at 7:27 PM, Duncan Murdoch <murdoch at stats.uwo.ca>
wrote:
On 09/01/2010 6:31 PM, Gabor Grothendieck wrote:
That doesn't explain why this returns character(o) even though we
have
launched a console for it:
system("cmd /c C:\\windows\\system32\\find /?", intern = TRUE)
I don't see any console launched. R redirects stdin and stdout (and stderr, I think), and it appears that Windows doesn't open a console. I do
see a
console flash by if I do
system('cmd /c c:/WINDOWS/system32/find.exe /?', wait=FALSE,
invisible=FALSE)
but of course then we don't capture the output, so it's not very
useful.
Looking at the source, the only case where we ask to create a console
is
the combination "wait=FALSE, invisible=FALSE", but there might be combinations of other options that make this a default. The MS documentation says that a console will be created automatically for
any
console application, but that doesn't appear to be happening. So I guess you could get find.exe to work by calling it from a batch
file
with a "pause" at the end and using the wait=FALSE,invisible=FALSE options. The above observations are in Win XP SP3, not anything newer. Duncan Murdoch
On Sat, Jan 9, 2010 at 5:24 PM, Duncan Murdoch <murdoch at stats.uwo.ca> wrote:
On 07/01/2010 1:25 PM, Uwe Ligges wrote:
Argh. I see it as well. Will dig a lit tomorrow.
I don't know exactly what's going on, but it looks as though it is something specific to the find.exe utility, e.g. maybe it is assuming that
it's
being run inside a console and reading CONIN$ or writing to CONOUT$
without
checking whether they can be opened. When you run it from Rterm,
Rterm
is in a console, which appears to be good enough. So it may be anyone who wants to use it will have to contact
Microsoft
to find out how... Duncan Murdoch
Uwe On 07.01.2010 12:25, Gabor Grothendieck wrote:
I get a problem with shell too: Under Rgui:
R.version.string
[1] "R version 2.10.1 Patched (2010-01-01 r50884)"
system("C:\\windows\\system32\\find /?", intern = TRUE)
character(0)
system("cmd /c C:\\windows\\system32\\find /?", intern = TRUE)
character(0)
shell("C:\\windows\\system32\\find /?")
Warning message:
In shell("C:\\windows\\system32\\find /?") :
'C:\windows\system32\find /?' execution failed with error code 1
They all work, i.e. they give the required help message, under
Rterm
and when I issue this from the Windows console it works: C:\windows\system32\find /? 2010/1/7 Uwe Ligges<ligges at statistik.tu-dortmund.de>:
On 07.01.2010 02:04, Gabor Grothendieck wrote:
If you have C:\Rtools\bin on your PATH note that it contains a UNIX-like find utility that conflicts with the find utility in Windows. If that is the problem then remove that from your PATH and then run the batch file. The batchfiles distribution at http://batchfiles.googlecode.com has utilities (Rgui.bat, R.bat, Rtools.bat, etc.) that will automatically add C:\Rtools\bin to your path temporarily or only while R is running so that you can leave it off your PATH.
I guess it's the use of system() rather than shell() that causes
the
problem. Under Windows, you have to use shell in order to start a command interpreter. Uwe Ligges
On Wed, Jan 6, 2010 at 6:51 PM, John
Schexnayder<jschex at us.ibm.com>
wrote:
This is sort of a strange bug. Not show stopping, but
annoying.
I was wondering if anyone else has noticed this and reported it
before I
submit a bug report. I noticed while running the RGui and attempting to debug one of
my
scripts that I encountered a Windows error informing me that "Find
String
[grep] Utility has encountered a problem and needs to close." It is being generated by a call to a DOS batch file which contains a call
to
Find.exe.
It can be reproduced by simply typing "System("find")" in
RGui.
What I found strange is that I have been running this script daily without this problem for months. I now realize I never ran that portion of
the
script while in RGui.exe. It has always run in batch mode which is
done
by
Rterm.exe.
I have tried this on three separate machines now all running
Windows
XP
SP3, with versions of R 2.8.1 and R 2.10.1 If executing
"System("find")
under RGui, an error window for the Find String Utility is
generated
and
the command is not exectuted. If the same command is issued in
Rterm
the
expected "FIND: Parameter format not correct" message is
properly
returned.
It doesn't seem an important bug, but it could be the canary in
the
mine
for a larger problem somewhere down the road.
Re,
John Schexnayder
IBM Tape Manufacturing - Information Technology
San Jose, CA 95138
JSchex at us.ibm.com
[[alternative HTML version deleted]]
______________________________________________ R-help at r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible
code.
______________________________________________ R-help at r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible
code.
______________________________________________ R-help at r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
10 days later
On 10/01/2010 1:51 PM, Duncan Murdoch wrote:
On 10/01/2010 1:42 PM, Gabor Grothendieck wrote:
Perhaps you can add it to the bug list before you leave it including what you tried in case its a symptom of some larger underlying problem.
This list is archived, so there's a record. But I think this is a find bug, not an R bug, so it doesn't make sense to add it to the R bug list.
Turns out it was probably both. R definitely had a bug, and find reacted to it in a fairly strange way. I've just committed fairly extensive changes to the low-level system() and related code in R. They fix some problems reported yesterday in Windows 7, as well as the find.exe problems reported in this thread. They may introduce some new ones; please test and let me know if you see anything. I committed the changes to both R-devel and R-patched; builds after r51015 should contain them. Duncan Murdoch
Duncan Murdoch
On Sun, Jan 10, 2010 at 1:24 PM, Duncan Murdoch <murdoch at stats.uwo.ca> wrote:
I'm quitting on this one. For the record, I took a look at a fairly old
version of the Tcl code (from 8.4.13) that I had around from an old attempt
to get it to work properly with MDI windows. There are a number of
differences between their exec code and our system() code, but I couldn't
find the right combination to get system() to be able to run find. It
always crashes with a seg fault in ulib.dll when run with input coming from
the pipe we send it.
If you use input redirection on the command line, it's fine, for example
system("cmd /c c:/WINDOWS/system32/find /? <nul")
or
shell("c:/WINDOWS/system32/find \"Hello\" c:/temp/foo.txt <nul")
So perhaps we're not setting up the pipe correctly, but it works with most
other programs, so I'm going to assume find is using it incorrectly, unless
someone points out what we're doing wrong.
Duncan Murdoch
On 10/01/2010 8:18 AM, Gabor Grothendieck wrote:
I noticed this does work, i.e. it displays the requested help info, in
Rgui on my Vista system:
library(tcltk)
.Tcl("exec find /?")
On Sat, Jan 9, 2010 at 7:27 PM, Duncan Murdoch <murdoch at stats.uwo.ca>
wrote:
On 09/01/2010 6:31 PM, Gabor Grothendieck wrote:
That doesn't explain why this returns character(o) even though we have
launched a console for it:
system("cmd /c C:\\windows\\system32\\find /?", intern = TRUE)
I don't see any console launched. R redirects stdin and stdout (and
stderr,
I think), and it appears that Windows doesn't open a console. I do see a
console flash by if I do
system('cmd /c c:/WINDOWS/system32/find.exe /?', wait=FALSE,
invisible=FALSE)
but of course then we don't capture the output, so it's not very useful.
Looking at the source, the only case where we ask to create a console is
the combination "wait=FALSE, invisible=FALSE", but there might be
combinations of other options that make this a default. The MS
documentation says that a console will be created automatically for any
console application, but that doesn't appear to be happening.
So I guess you could get find.exe to work by calling it from a batch file
with a "pause" at the end and using the wait=FALSE,invisible=FALSE
options.
The above observations are in Win XP SP3, not anything newer.
Duncan Murdoch
On Sat, Jan 9, 2010 at 5:24 PM, Duncan Murdoch <murdoch at stats.uwo.ca> wrote:
On 07/01/2010 1:25 PM, Uwe Ligges wrote:
Argh. I see it as well. Will dig a lit tomorrow.
I don't know exactly what's going on, but it looks as though it is something specific to the find.exe utility, e.g. maybe it is assuming that it's being run inside a console and reading CONIN$ or writing to CONOUT$ without checking whether they can be opened. When you run it from Rterm, Rterm is in a console, which appears to be good enough. So it may be anyone who wants to use it will have to contact Microsoft to find out how... Duncan Murdoch
Uwe On 07.01.2010 12:25, Gabor Grothendieck wrote:
I get a problem with shell too: Under Rgui:
R.version.string
[1] "R version 2.10.1 Patched (2010-01-01 r50884)"
system("C:\\windows\\system32\\find /?", intern = TRUE)
character(0)
system("cmd /c C:\\windows\\system32\\find /?", intern = TRUE)
character(0)
shell("C:\\windows\\system32\\find /?")
Warning message:
In shell("C:\\windows\\system32\\find /?") :
'C:\windows\system32\find /?' execution failed with error code 1
They all work, i.e. they give the required help message, under Rterm
and when I issue this from the Windows console it works:
C:\windows\system32\find /?
2010/1/7 Uwe Ligges<ligges at statistik.tu-dortmund.de>:
On 07.01.2010 02:04, Gabor Grothendieck wrote:
If you have C:\Rtools\bin on your PATH note that it contains a UNIX-like find utility that conflicts with the find utility in Windows. If that is the problem then remove that from your PATH and then run the batch file. The batchfiles distribution at http://batchfiles.googlecode.com has utilities (Rgui.bat, R.bat, Rtools.bat, etc.) that will automatically add C:\Rtools\bin to your path temporarily or only while R is running so that you can leave it off your PATH.
I guess it's the use of system() rather than shell() that causes the problem. Under Windows, you have to use shell in order to start a command interpreter. Uwe Ligges
On Wed, Jan 6, 2010 at 6:51 PM, John Schexnayder<jschex at us.ibm.com> wrote:
This is sort of a strange bug. Not show stopping, but annoying.
I
was
wondering if anyone else has noticed this and reported it before I
submit
a bug report.
I noticed while running the RGui and attempting to debug one of my
scripts
that I encountered a Windows error informing me that "Find String
[grep]
Utility has encountered a problem and needs to close." It is
being
generated by a call to a DOS batch file which contains a call to
Find.exe.
It can be reproduced by simply typing "System("find")" in RGui.
What I
found strange is that I have been running this script daily
without
this
problem for months. I now realize I never ran that portion of the
script
while in RGui.exe. It has always run in batch mode which is done
by
Rterm.exe.
I have tried this on three separate machines now all running
Windows
XP
SP3, with versions of R 2.8.1 and R 2.10.1 If executing
"System("find")
under RGui, an error window for the Find String Utility is
generated
and
the command is not exectuted. If the same command is issued in
Rterm
the
expected "FIND: Parameter format not correct" message is properly
returned.
It doesn't seem an important bug, but it could be the canary in
the
mine
for a larger problem somewhere down the road.
Re,
John Schexnayder
IBM Tape Manufacturing - Information Technology
San Jose, CA 95138
JSchex at us.ibm.com
[[alternative HTML version deleted]]
______________________________________________ R-help at r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
______________________________________________ R-help at r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
______________________________________________ R-help at r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
______________________________________________ R-help at r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.