delorie.com/archives/browse.cgi | search |
> From: "Stephen J. Turnbull" <turnbull AT sk DOT tsukuba DOT ac DOT jp> > Date: Sat, 20 Jul 2013 23:15:01 +0900 > > Can you read from a (FILE*|file descriptor) opened in mode 'w' in a > DJGPP program? You get EOF if you do. > I would assume that the designers wanted to avoid situations where > FILE* or fd is passed around and somebody gets confused and overwrites > a file that was supposed to be readonly. DJGPP supports this by returning EOF in both "read from ofp" and "write to ifp" scenarios. So it effectively prohibits both, as you'd expect. The issue is something else: whether ferror should return true or false after you try those scenarios.
webmaster | delorie software privacy |
Copyright © 2019 by DJ Delorie | Updated Jul 2019 |