digitalmars.D.learn - append - too many files
- Joel (13/13) Jan 10 2023 I get this error after a while (seems append doesn't close the
- H. S. Teoh (6/21) Jan 10 2023 This is a bug, please file an issue in mantis. Phobos functions should
- Salih Dincer (6/8) Jan 10 2023 There is no error in the function or Phobos. There may be
- Joel (6/14) Jan 10 2023 I kinda have an update function that gets the update text, it
I get this error after a while (seems append doesn't close the file each time): std.file.FileException 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; } ```
Jan 10 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 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
Jan 10 2023
On Wednesday, 11 January 2023 at 02:15:13 UTC, Joel wrote:I get this error after a while (seems append doesn't close the file each time):There is no error in the function or Phobos. There may be another error on your system or depending on how you use it. Could it be that more than one program tried to open the same file? How do you use this function? SDB 79
Jan 10 2023
On Wednesday, 11 January 2023 at 06:00:26 UTC, Salih Dincer wrote:On Wednesday, 11 January 2023 at 02:15:13 UTC, Joel wrote:I kinda have an update function that gets the update text, it writes it to the terminal, to a text file and returns the text (for like display on screen). Oh, looking at my code now, I was looking at the wrong function. Not to do with append. Sorry, forget about it.I get this error after a while (seems append doesn't close the file each time):There is no error in the function or Phobos. There may be another error on your system or depending on how you use it. Could it be that more than one program tried to open the same file? How do you use this function? SDB 79
Jan 10 2023