I need a function called SizeOfPipe()
which should return the size of a pipe - I only want to know how much data is in the pipe and not actually read data off t
It's not in general possible to know the amount of data you can read from a pipe just from the pipe handle alone. The data may be coming in across a network, or being dynamically generated by another process. If you need to know up front, you should arrange for the information to be sent to you - through the pipe, or out of band - by whatever process is at the other end of the pipe.