Re: close(writefile)
- Posted by useless_ Dec 20, 2012
- 1203 views
DerekParnell said...
It might be possible to change the built-in close routine into a function that returns -1 when it successfully closes a file, but we'd have to think that through a bit more for ramifications to existing code.
But -1 is an error flag. A file being closed isn't an error, i have at least 100 lbs of closed files. For now, i set writefile to zero to detect if i ever opened the writefile in question. So 4 = i'm writing, -1 = there's some error, 0 = better open it first. Come to think of it, maybe some other (nested) flag(s) which also show(s) how it was open, like "ab", or "w", and when, and maybe who.
useless