<div dir="auto">Yes using FILE* directly could be the way.  But using file.rawRead is still possible. But it is better to use static array with length one. Other problem is with string.  It would make sense make it out instead of ref and change it to empty string and use RefAppender. </div><div class="gmail_extra"><br><div class="gmail_quote">Dne 7. 12. 2017 9:00 odp. napsal uživatel "Steven Schveighoffer via Digitalmars-d" <<a href="mailto:digitalmars-d@puremagic.com">digitalmars-d@puremagic.com</a>>:<br type="attribution"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">On 12/7/17 1:26 PM, Daniel Kozak wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
This is not about write the best D code. It is about similar code to perform same. However when I looked at the D code it is not good port of C/C++. He made many mistakes which make it slower than C/C++ counterpart.<br>
One example is read_one_line function:<br>
C++: <a href="https://github.com/jpakkane/pkg-config/blob/cpp/parse.cpp#L60" rel="noreferrer" target="_blank">https://github.com/jpakkane/pk<wbr>g-config/blob/cpp/parse.cpp#L6<wbr>0</a><br>
D: <a href="https://github.com/jpakkane/pkg-config/blob/d/parse.d#L57" rel="noreferrer" target="_blank">https://github.com/jpakkane/pk<wbr>g-config/blob/d/parse.d#L57</a><br>
</blockquote>
<br>
Wow, interesting that D uses less memory with that continue new char[1] in there!<br>
<br>
Kind of funny that he didn't just use FILE * directly, it's totally available in D :)<br>
<br>
-Steve<br>
</blockquote></div></div>