Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

8
  • and I don't understand file descriptors are implemented as an integer. Elaborate in detail please. Commented Sep 13, 2011 at 11:01
  • That's what I already knew, but the quote is saying that the programs write "on" that integer?? Does it mean that they refer to the file on which they have to write using that integer, only? Commented Sep 13, 2011 at 11:07
  • @Anisha - The quote said "reading or writing to a file descriptor". A file descriptor is just what you get back from open. When you call read(fd, ...) you're making a request to read from a specific file descriptor. Likewise write(fd, ...) is a request to write to a specific file descriptor. Commented Sep 13, 2011 at 11:10
  • Well, write(fd, ...) is a request to write to a file descriptor you can't write to an integer? Can you? YOu can just use that integer to "refer" to some file to which you intend to write? Commented Sep 13, 2011 at 11:11
  • 1
    @Anisha - I wouldn't say it was ambiguous. The implication seems clear enough that the file descriptor is used as part of an abstraction of the IO operations on a specific file. I think it might well be phrased in such a way as to (accidentally) presuppose knowledge of file IO though. Commented Sep 13, 2011 at 11:19