Using fseek with a file pointer that points to stdin

前端 未结 3 817
没有蜡笔的小新
没有蜡笔的小新 2020-11-28 15:52

Depending on command-line arguments, I\'m setting a file pointer to point either towards a specified file or stdin (for the purpose of piping). I then pass this pointer arou

3条回答
  •  被撕碎了的回忆
    2020-11-28 16:34

    Fseek() is based on lseek(), and the lseek man page discusses possible errors, including:

     [ESPIPE]           Fildes is associated with a pipe, socket, or FIFO.
    

    If stdin is connected to a pseudo tty, I believe it will have socket behavior.

提交回复
热议问题