A
Armin Gajda
Hi,
I have to write to a named pipe that was created by another
(VisualBasic) program. It is running all under Windows XP.
I have read it should work with an ordinary file operation, so I tried:
1: File file = new File("\\\\.\\pipe\\SamplePipe");
2: FileWriter fw = new FileWriter(file);
3: fw.write ("Hi folk!");
4: fw.close ();
and also with an FileOutputStream. But as soon as the second line is
executed, the external program terminates and I get the message:
java.io.FileNotFoundException: \\.\pipe\SamplePipe (Alle Pipeinstanzen
sind ausgelastet)
at java.io.FileOutputStream.open(Native Method)
at java.io.FileOutputStream.<init>(FileOutputStream.java:176)
at java.io.FileOutputStream.<init>(FileOutputStream.java:131)
at java.io.FileWriter.<init>(FileWriter.java:73)
(The message's meaning in english: all pipe instances are busy)
So it knows that there is a pipe access, because if the external program
is not running it simply says 'file not found'.
If I use:
File file = new File("\\\\.\\pipe\\SamplePipe");
System.out.println("writable: " + file.canWrite ());
I get a true, and the external application terminates (what is actually
not wanted).
I use JDK 1.4.1_03.
Any hints?
I have to write to a named pipe that was created by another
(VisualBasic) program. It is running all under Windows XP.
I have read it should work with an ordinary file operation, so I tried:
1: File file = new File("\\\\.\\pipe\\SamplePipe");
2: FileWriter fw = new FileWriter(file);
3: fw.write ("Hi folk!");
4: fw.close ();
and also with an FileOutputStream. But as soon as the second line is
executed, the external program terminates and I get the message:
java.io.FileNotFoundException: \\.\pipe\SamplePipe (Alle Pipeinstanzen
sind ausgelastet)
at java.io.FileOutputStream.open(Native Method)
at java.io.FileOutputStream.<init>(FileOutputStream.java:176)
at java.io.FileOutputStream.<init>(FileOutputStream.java:131)
at java.io.FileWriter.<init>(FileWriter.java:73)
(The message's meaning in english: all pipe instances are busy)
So it knows that there is a pipe access, because if the external program
is not running it simply says 'file not found'.
If I use:
File file = new File("\\\\.\\pipe\\SamplePipe");
System.out.println("writable: " + file.canWrite ());
I get a true, and the external application terminates (what is actually
not wanted).
I use JDK 1.4.1_03.
Any hints?