3 ms·
You don't keep the state "this file is opened", the kernel does. All you have is a ticket, the file descriptor. The problem is that the bookkeeping also includ
by dullgiulio 9y ago
You don't keep the state "this file is opened", the kernel does. All you have is a ticket, the file descriptor.
The problem is that the bookkeeping also includes the position in the file. I guess an API with a position argument could work, when you can leave it null for network operation (or unseekable file streams).
But again, this does not make the API completely stateless and for good performance reasons.