On Saturday, 22 July 2017 at 02:22:53 UTC, Mike Parker wrote:

I should add, though, that you're better off using either std.stdio.File or std.file. Use the former if you need to make multiple reads/writes to a file, the latter if you can pull it in or push it out all in one go. They take arrays as arguments, so if you have something like Data[], you can pass it directly to the appropriate functions. To write a single instance, you'll have to take the pointer and slice it. Either way, it's less code, less error prone, and more idiomatic than using the C API.

Well, it seems the toStringz() function adds a few garbage characters to the end of the filename, I might look into a way to read the data with Phobos instead of the C API.

Reply via email to