Thank you for the help. I have tried mounting the html5fs filesystem. When I tried opening the file, Null error is reported.
This is how I am requesting the filesystem:
window.webkitRequestFileSystem(window.TEMPORARY, 1024*1024, onInitFs, errorHandler1);
function onInitFs(fs) {
fs.root.getFile('log.txt', {create: true}, function(fileEntry) {
fileEntry.createWriter(function(fileWriter){
fileWriter.onwriteend = function(e) {
window.open('filesystem:chrome-extension://' + chrome.i18n.getMessage('@@extension_id') + '/temporary/' + 'log.txt');
console.log('Write completed.');
};
fileWriter.onerror = function(e) {
console.log('Write failed: ' + e.toString());
};
// Create a new Blob and write it to log.txt.
var blob = new Blob(['HELLO WORLD'], {type: 'text/plain'});
console.log('bb size:' + blob.size);
fileWriter.write(blob);
//fileWriter.writeLine("Another line");
}, errorHandler);
}, errorHandler);
}
function errorHandler(){
console.log('ERROR');
}
After loading the extension, I can see the file created under the chrome extension temporary folder.
This is my Nacl code:
int mount_success = mount(
"chrome-extension://efaaglhdpajbdnjnjfjhpnigocemogmh/temporary/", /* source */
"/MyMount", /* target */
"html5fs", /* filesystemtype */
0, /* mountflags */
"type=PERSISTENT,expected_size=1048576"); /* data */
PostMessage("Mounting Result: %d\n", mount_success);
Mount Value is resulting to 0.
I tried opening the file:
fp = fopen("/MyMount/log.txt","r");
Reporting NULL.