append - too many files
H. S. Teoh
hsteoh at qfbox.info
Wed Jan 11 04:23:43 UTC 2023
On Wed, Jan 11, 2023 at 02:15:13AM +0000, Joel via Digitalmars-d-learn wrote:
> I get this error after a while (seems append doesn't close the file
> each time):
> std.file.FileException at std/file.d(836): history.txt: Too many open files
>
> ```d
> auto jm_addToHistory(T...)(T args) {
> import std.conv : text;
> import std.file : append;
>
> auto txt = text(args);
> append("history.txt", txt);
>
> return txt;
> }
> ```
This is a bug, please file an issue in mantis. Phobos functions should
not leak file descriptors.
T
--
"No, John. I want formats that are actually useful, rather than over-featured megaliths that address all questions by piling on ridiculous internal links in forms which are hideously over-complex." -- Simon St. Laurent on xml-dev
More information about the Digitalmars-d-learn
mailing list