<div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div class="gmail_quote"><div dir="ltr">On Sat, Nov 10, 2018 at 4:39 AM Mattias Gaertner via Pas2js <<a href="mailto:pas2js@lists.freepascal.org">pas2js@lists.freepascal.org</a>> wrote:</div><div dir="ltr">[...]</div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
You didn't answer my question. How to access the data in the stream?<br>
The big advantage of Pascal streams is the ability to easily read/write<br>
any datatype. This is not possible in JS.<br>
What kind of alternative overloads do you plan?<br></blockquote><div><br></div><div>Please read the part "Indeed. But I have an idea which I would like to check if you agree" in my second message. That was the only way I found to make it to work for any data type.</div><div><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
NodeJS has streams. They support writing strings/buffer/uint8array and<br>
strings support encoding. So the NodeJS implementation is easier than<br>
the browser implementation.<br></blockquote><div><br></div><div>I totally agree. But we should provide at least a way using local/sessionstorage with the possibility to download it to a file (as showed in my previous example).</div><div><br></div><div>I'm not sure if the JS unit already maps the browser storage interfaces, but we can write it (if you agree the ideia I showed in the second message).</div><div><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
I started the nodejs external classes in unit nodejsfs. Feel free to<br>
complete the external classes. Note that nodejsfs is currently a mix<br>
up of streaming classes, filesystem class and Pascal RTL functions like<br>
FileExists. It is planned to distribute these parts to multiple units.</blockquote><div><br></div><div>Awesome. I'll check this as soon as we find a solution for the browser side (it think we are almost there ...).<br></div><div><br></div></div>-- <br><div dir="ltr" class="gmail_signature"><div dir="ltr"><div>Silvio Clécio</div></div></div></div></div></div></div></div>