oecumena
Joined 7 years ago
Karma
185
Submissions
37
Member since
Jan 27
Joined 7 years ago
ISO/IEC 9899:TC3 7.19.1
FILE
which is an object type capable of recording all the information needed to control a
stream, including its file position indicator, a pointer to its associated buffer (if any), an
error indicator that records whether a read/write error has occurred, and an end-of-file
indicator that records whether the end of the file has been reached;
Hence no stream can be longer than 2^(sizeof(FILE)*CHAR_BIT) (6.2.6.1 guarantees that objects of any type cannot have "hidden" bits of state not accounted by sizeof()).You can advance an argument that even though each stream is limited, you can have an infinite number of streams, but this does not work, because stream name is a string, and there is only finite number of possible strings and the standard library does not contain chdir().