<div dir="ltr">Hi,<div><br></div><div>I'm studying Erlang and have a simple question. In my http request function i'm using stream to save the output to the file. The question is how to replace the file content instead of adding additional data to it? </div><div><br></div><div><div>fetch_db_ver() -></div><div><span class="" style="white-space:pre">            </span>httpc:request(get,</div><div><span class="" style="white-space:pre">                         </span>{"<a href="http://www.domain.com/CURRENTDBVERSION">http://www.domain.com/CURRENTDBVERSION</a>",[]},</div><div><span class="" style="white-space:pre">                                </span>[],</div><div><span class="" style="white-space:pre">                                </span>[{stream, "CURRENTDBVERSION"}]</div><div><span class="" style="white-space:pre">                           </span>).</div><div><br></div><div><div>current_version() -></div><div><span class="" style="white-space:pre">                               </span>file:read_file("CURRENTDBVERSION").</div></div><div><br></div><div><br></div><div>So, instead of </div><div><br></div><div>32154810<br></div><div><br></div><div>I'm getting  "3215334632153346321533463215334632154810"</div><div><br></div><div>19> db:current_version().                                                  </div><div>{ok,<<"3215334632153346321533463215334632154810">>}<br></div><div><br></div>-- <br><div class="gmail_signature"><div dir="ltr">Thanks a lot,<br>Yury.</div></div>
</div></div>