dcsimg
Usage of NamedPipes in Java?
0 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Anonymous
Posted On:   Thursday, June 15, 2006 12:16 AM

Hi friends , I am using Named pipes concept of solaris and i am trying to open a Named Pipe and write some thing to it.it's changing as a normal file instead of a piped file.the code is given below.please elp me in this . package test; import java.io.BufferedOutputStream; import java.io.File; import java.io.FileOutputStream; public class NamedPipe1 { public static void main(String[] args) throws Exception { File outFile = new File("testfile1"); if (!outFile.exists()) { Runtime rt = Runtime.getRuntime(); rt.exec("mkfifo testfile"); } String toWrite = "Test Data to be written in piped file&quo   More>>

Hi friends ,

I am using Named pipes concept of solaris and i am trying to open a Named Pipe and write some thing to it.it's changing as a normal file instead of a piped file.the code is given below.please elp me in this .

			

package test;

import java.io.BufferedOutputStream;
import java.io.File;
import java.io.FileOutputStream;

public class NamedPipe1 {

public static void main(String[] args) throws Exception {
File outFile = new File("testfile1");

if (!outFile.exists()) {
Runtime rt = Runtime.getRuntime();
rt.exec("mkfifo testfile");
}

String toWrite = "Test Data to be written in piped file";
FileOutputStream fStream = new FileOutputStream(outFile);
BufferedOutputStream bStream = new BufferedOutputStream(fStream);//
bStream.write(toWrite.getBytes());
bStream.flush();
bStream.close();
fStream.close();
}
}


Thanks & Regards,

Krishna Rajendra    <<Less
About | Sitemap | Contact