Read a file purely in javascript on Firefox OS(B2G)

163 Views Asked by At

I have to read a file from the file system of my phone. Essentially its to check if the file contains a word. The file is located in the /sys folder of my phone. I know I can get the contents of the File using FileReader.readAsText(file) to get the contents as a string and then parse it for the word. But how do I make the "file" object to pass to the FileReader object. Thanks in advance!

Edit: Just wanted to add here:

Can I use the File constructor here?

var file = File("/path/to/file");

1

There are 1 best solutions below

0
On

You can only read data from your app folder (via XMLHttpRequest) and from the SD Card. You cannot read data from any other place in a Firefox OS app.