Yesterday I was shown the concept of named pipes (also called fifos), but it seems that java can't handle them?
I made a fifo in my home directory with mkfifo clip and wrote a little script to link a purpose to it:
This all works perfect, but now the problem:
if [ -p $LOC ]
xclip -in < $LOC > out
echo "$LOC doesn't exist or is no named pipe, exiting"
When I write this in java:
the application just hangs on that line... No extensive cpu load, no exceptions, just nothing...
PrintWriter pW=new PrintWriter(new BufferedOutputStream(new FileOutputStream(new File("/home/ramses/clip"))));
If I create just an OutputStream it works, but not with a PrintWriter.
The same line does work on a regular file.
Anyone who can explain this and maybe knows a workaround?
And the file permissions are set to 777 so that isn't the problem, I can also perfectly write to it from the command line.