3 ms·
Here's some example C using one: bytesRead = read(fd, buf, BUF_SIZE - 1) You read the from the file descriptor into the buffer. Just like in Go you read
by jonahx 3y ago
Here's some example C using one:
bytesRead = read(fd, buf, BUF_SIZE - 1)
You read the from the file descriptor into the buffer. Just like in Go you read from a file into a byte array. Neither the file descriptor nor the file is conceptualized as a tool for reading. The file descriptor is merely an abstraction of the file, which extends the concept of "file" to include pipes, sockets, and other io.