-
Bug
-
Resolution: Duplicate
-
P3
-
None
-
7u21
FULL PRODUCT VERSION :
1.7.0_21
ADDITIONAL OS VERSION INFORMATION :
Windows 7 Professional 64 Bit
Service Pack 1
A DESCRIPTION OF THE PROBLEM :
The ProcessBuilder ignores a pipe symbol (>) in the DIR command.
The command " cmd /c dir c: > c:/dir.txt " should create the file c:/dir.txt.
Since jdk7u21 the file is not created. No exceptions are thrown.
REGRESSION. Last worked in version 7u17
STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
Compile and execute the specified source code.
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
The file c:/dir.txt should be created.
ACTUAL -
No file created.
REPRODUCIBILITY :
This bug can be reproduced always.
---------- BEGIN SOURCE ----------
import java.io.IOException;
public class JavaTest {
public static void main(String[] args) {
try {
ProcessBuilder builder = new ProcessBuilder( " cmd " , " /c " , " dir " , " c: " , " > " , " c:/dir.txt " );
builder.start();
} catch (IOException e) {
e.printStackTrace();
}
}
}
---------- END SOURCE ----------
1.7.0_21
ADDITIONAL OS VERSION INFORMATION :
Windows 7 Professional 64 Bit
Service Pack 1
A DESCRIPTION OF THE PROBLEM :
The ProcessBuilder ignores a pipe symbol (>) in the DIR command.
The command " cmd /c dir c: > c:/dir.txt " should create the file c:/dir.txt.
Since jdk7u21 the file is not created. No exceptions are thrown.
REGRESSION. Last worked in version 7u17
STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
Compile and execute the specified source code.
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
The file c:/dir.txt should be created.
ACTUAL -
No file created.
REPRODUCIBILITY :
This bug can be reproduced always.
---------- BEGIN SOURCE ----------
import java.io.IOException;
public class JavaTest {
public static void main(String[] args) {
try {
ProcessBuilder builder = new ProcessBuilder( " cmd " , " /c " , " dir " , " c: " , " > " , " c:/dir.txt " );
builder.start();
} catch (IOException e) {
e.printStackTrace();
}
}
}
---------- END SOURCE ----------
- duplicates
-
JDK-8012453 (process) Runtime.exec(String) fails if command contains spaces [win]
- Closed