Hi,
On Jun 18, 5:36 pm, soubok <
sou...@gmail.com> wrote:
>
> *note 1:*
> I recommend you to replace '\\' with directorySeparator.
>
> *note 2:*
> file.open(File.RDONLY);
> sockdata = stringify(file.read());
> file.close();
> can be replaced with:
> sockdata = stringify(file.content);
the above didn't work as it couldn't find stringify() so I tried this
instead:
sockdata = JSON.stringify(file.content);
which crashed the application every time. So I reverted to this:
file.open(File.RDONLY);
var content = file.read();
file.close();
sockdata = JSON.stringify(content);
This put sockdata as '{}' (those are not file contents). Then i found
a function to do the same:
function buffToString(arbuff)
{
var str=new Array();
var buff = new Uint8Array( arbuff );
var index =0;
for ( index=0; index< buff.length ;index++)
{
str[index] = String.fromCharCode(buff[index]);
}
return str.join("");
}
Problem is it looses the newline chars.
I should have mentioned this before but I am trying to use this inside
spidermonkey 1.8.5 running inside OpenVxi engine. And I am trying to
use timezoneJS implementation of date/time (which uses jsio) to parse
through timezone files.
Thanks,
Anshuman