3 ms·
How would you pass an open file by value? What happens when one copy tries to close the file while another still has it open?
by Gigachad 4y ago
How would you pass an open file by value? What happens when one copy tries to close the file while another still has it open?
- starbugs 4y agoUse a handle and pass that by value?
- UncleMeat 4y agoHow do you implement a handle if pointers aren't allowed?
- starbugs 4y agoCall a function that is implemented in C returning you the handle? I didn't say it's a good idea… Isn't that how PHP started off?
- bruce343434 4y agoSo a pointer into the file system?
- starbugs 4y agoIt’s more like an abstract reference to an opened file.
- icedchai 4y agoUse a file descriptor (int)?