Disk write in a "for" loop with RwMutex never happens

Gavin Ray ray.gavin97 at gmail.com
Mon Aug 29 20:16:50 UTC 2022


On Monday, 29 August 2022 at 15:52:31 UTC, rikki cattermole wrote:
> After a bunch of playing around I managed to determine that it 
> is as simple as the mode.
>
> exists(dbFileName) ? "r+" : "w+"
>
>
>
> Will fix it.
>
> Of course you shouldn't delete the file like that method is 
> doing. It should probably reinitialize the FILE* descriptor.

D'oh!

I didn't even think about the mode:

   > `a+ or ab+ or a+b`
   > "Append; open or create file for update, writing at 
end-of-file."

It must have been the "writing at end of file" bit?

Thanks Rikki. /embarrassed


More information about the Digitalmars-d-learn mailing list