<div style="line-height:1.7;color:#000000;font-size:14px;font-family:Arial"><div>Hi ,</div><div><br></div><div>   This will help you  . <a href="https://wiki.freeswitch.org/wiki/File" _src="https://wiki.freeswitch.org/wiki/File">https://wiki.freeswitch.org/wiki/File</a> </div><div>   </div><div style="position:relative;zoom:1"></div><div id="divNeteaseMailCard"></div><div>Raymond</div><div><br></div>At 2017-06-22 21:49:33, "Faruq Ahmad" <afarooqa@gmail.com> wrote:<br> <blockquote id="isReplyContent" style="PADDING-LEFT: 1ex; MARGIN: 0px 0px 0px 0.8ex; BORDER-LEFT: #ccc 1px solid"><div dir="ltr">Hi,<br><br>I have a FS dialplan that fetches callflow from a JSON file. File is read using <br><br>var JsonFd = new FileIO(JsonPath, 'r');<br><div>JsonFd.read(2048);</div><div><div>result = JsonFd.data();</div></div><div><div>var menu = JSON.parse(result),</div></div><div><br>Is there anyway I can read the whole file in one attempt, i.e. when a smaller size was given to the .read() function it wouldn't read the complete file. I have increased the value of size for read function however my concern is in the long run file size might increase and parse would get an incomplete JSON. <br><br>Is there anyway I can get filesize from FileIO object or detect EOF from the read buffer to make sure the whole file is loaded?<br>Also if I increase the size for read fucntion buffer way over the estimated filesizes, is there any guarantee that no garbage values will be read from the disk after the EOF?</div></div>
</blockquote></div><br><br><span title="neteasefooter"><p> </p></span>