when I run the following pipeline:
cat my_large_file.txt | head | wc
the process stops almost immediately. OK
but when i run my java program
java MyProgramReadALargeFile my_large_file.txt | head | wc
the output from "wc" is printed on stdout, but the java program continues to work . How can he detect that the pipeline is closed?
Thank,
source
share