I’m trying to write a simple text file reader by creating a function that takes in the file’s path and converts each line of text into a char array, but it’s not working.
Jon Perryman,
Yes js can read local files (see FileReader()) but not automatically: the user has to pass the file or a list of files to the script with an html .
Then with js it is possible to process (example view) the file or the list of files, some of their properties and the file or files content.
What js cannot do for security reasons is to access automatically (without the user input) to the filesystem of his computer.
To allow js to acccess to the local fs automatically is needed to create not an html file with js inside it but an hta document.
An hta file can contain js or vbs inside it.
But the hta executable will work on windows systems only.
This is standard browser behavior.
Also google chrome worked at the fs api, more infos here: http://www.html5rocks.com/en/tutorials/file/filesystem/