12
fileno 함수를 사용하여 FILE * 스트림에서 파일 설명자를 가져올 수 있습니다. 파일을 다시 열지 않고 파일 설명자에서 FILE * 스트림을 가져 오는 함수가 있습니까?파일 설명자에서 FILE * 스트림을 가져 오는 방법은 무엇입니까?
fileno 함수를 사용하여 FILE * 스트림에서 파일 설명자를 가져올 수 있습니다. 파일을 다시 열지 않고 파일 설명자에서 FILE * 스트림을 가져 오는 함수가 있습니까?파일 설명자에서 FILE * 스트림을 가져 오는 방법은 무엇입니까?
FILE *fdopen(int fd, const char *mode);
는 fdopen(3)
참조하지만 fopen(3)
The fdopen() function associates a stream with the existing file
descriptor, fd. The mode of the stream (one of the values "r", "r+",
"w", "w+", "a", "a+") must be compatible with the mode of the file
descriptor. The file position indicator of the new stream is set to
that belonging to fd, and the error and end-of-file indicators are
cleared. Modes "w" or "w+" do not cause truncation of the file. The
file descriptor is not dup’ed, and will be closed when the stream cre‐
ated by fdopen() is closed. The result of applying fdopen() to a
shared memory object is undefined.
같은 페이지에 있어야합니다