digitalmars.D - FILE * ?
- Arcane Jill (12/12) Jul 09 2004 From the docs...
- Walter (10/21) Jul 09 2004 stdout.
From the docs... Shouldn't Phobos be encouraging the use of std.stream? Shouldn't Phobos be discouraging the use of fopen(), and other C wrappers where sufficient or better D functionality exists? I don't want to percieve D as a convenient way to call C functions. fopen() is not OO and it is not safe. The stream does not close if an exeception is thrown between fopen() and fclose(). It is possible to forget to call fclose(). fclose() will crash if you call it twice. I humbly suggest that fwritef() be removed, and re-inserted as a member function of std.stream. Jill
Jul 09 2004
"Arcane Jill" <Arcane_member pathlink.com> wrote in message news:cclipj$1imt$1 digitaldaemon.com...From the docs...stdout.Shouldn't Phobos be encouraging the use of std.stream? Shouldn't Phobos be discouraging the use of fopen(), and other C wrapperswheresufficient or better D functionality exists? I don't want to percieve D as a convenient way to call C functions.fopen() isnot OO and it is not safe. The stream does not close if an exeception isthrownbetween fopen() and fclose(). It is possible to forget to call fclose(). fclose() will crash if you call it twice. I humbly suggest that fwritef()beremoved, and re-inserted as a member function of std.stream.I wrote std.format.doFormat() so it could be hooked up to anything - both FILE*'s and streams, as well as generating formatted strings. See std.string.format() for the latter.
Jul 09 2004