Re: What is the difference between "writeFile" and "newFileStream" and "write"?

2019-11-11 Thread nnahito
Thank you reply! I used the nim language 1.0. 0. As you pointed out, I will update to 1.0. 2. Thank you!

Re: What is the difference between "writeFile" and "newFileStream" and "write"?

2019-11-09 Thread Araq
Note that the writing of binary files was broken for 1.0.0 on Windows and 1.0.2 contains the fix.

Re: What is the difference between "writeFile" and "newFileStream" and "write"?

2019-11-09 Thread Vindaar
The answer is simply: writeFile sure can write those and it shouldn't break it. I do essentially the same here, the only difference is where the image comes from: [https://github.com/brentp/nim-plotly/blob/master/src/plotly/image_retrieve.nim#L119](https://github.com/brentp/nim-plotly/blob/maste

Re: What is the difference between "writeFile" and "newFileStream" and "write"?

2019-11-09 Thread nnahito
Thank you for an answer. Can't writeFile write binaries? When writeFile writes, how does it break the image file?

Re: What is the difference between "writeFile" and "newFileStream" and "write"?

2019-11-09 Thread mashingan
AFAIK, `Stream` is usually when you're dealing with bytes; whether opening binary files, or reading/writing network bytes stream, or reading/writing bytes to file etc. Especially for writing bytes, just like in the example.

What is the difference between "writeFile" and "newFileStream" and "write"?

2019-11-09 Thread nnahito
I would like to download an image file from the server and save it on my PC by nim language. At first, I wrote the following code:. import httpclient let url = "https://nnahito.com/images/nna_chara1.png";# This is my server var client = newHttpClient() var