direct system() output to socket
Posted on 2000-03-01
We have a client app that connects to a server. The server executes system() command(s), directing the output to a file. The system command may be calling a batch. We then read the file and send the contents back to the client. Ideally the ouput would be send to the client as it happens, instead of all at the end. Is is possible to direct the ouput to an open socket? I guess we could fork(), call system(), and then poll the file, but seems like there should be an easier way.