Determine the size of a pipe without calling read()

后端 未结 13 914
无人共我
无人共我 2020-12-19 03:56

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

13条回答
  •  挽巷
    挽巷 (楼主)
    2020-12-19 04:52

    You can wrap it in object with buffering that can be rewinded. This would be feasible only for small amounts of data.

    One way to do this in C is to define stuct and wrap all functions operating on pipes for your struct.

提交回复
热议问题