Important Notice: Our web hosting provider recently started charging us for additional visits, which was unexpected. In response, we're seeking donations. Depending on the situation, we may explore different monetization options for our Community and Expert Contributors. It's crucial to provide more returns for their expertise and offer more Expert Validated Answers or AI Validated Answers. Learn more about our hosting issue here.

When I type the command “cat” to my program, it just hangs. Whats wrong?

cat Command hangs program type wrong
0
Posted

When I type the command “cat” to my program, it just hangs. Whats wrong?

0

When the “cat” command is called with no arguments, it copies standard input to standard output. Since you don’t use getOutputStream() to pass data to the standard input of a process, it will just sit there forever waiting for input. The assignment specifically says that you don’t have to deal with the standard input of the processes you create. Thus this behavior is not a bug but a “feature”! Similarly, “more” (or “less”) will not do anything useful.

Related Questions

What is your question?

*Sadly, we had to bring back ads too. Hopefully more targeted.

Experts123