mirror of
https://github.com/apache/cordova-android.git
synced 2026-04-23 00:00:09 +08:00
Minor change for synchronous write. This seems like a bad idea.
This commit is contained in:
@@ -195,17 +195,10 @@ FileReader.prototype.readAsText = function(file)
|
||||
navigator.fileMgr.addFileReader(this.fileName,this);
|
||||
//alert("Calling File.read : " + this.fileName);
|
||||
//window.location = "gap://File.readFile/"+ file;
|
||||
this.onerror = errorCallback;
|
||||
this.oncomplete = successCallback;
|
||||
|
||||
return FileUtil.read(fileName);
|
||||
}
|
||||
|
||||
FileReader.prototype.hasRead(data)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
// File Writer
|
||||
|
||||
function FileWriter()
|
||||
@@ -232,6 +225,10 @@ FileWriter.prototype.writeAsText = function(file,text,bAppend)
|
||||
navigator.fileMgr.addFileWriter(file,this);
|
||||
this.readyState = 0; // EMPTY
|
||||
var call = FileUtil.write(file, text, bAppend);
|
||||
if(call > 0)
|
||||
this.onerror();
|
||||
else
|
||||
this.oncomplete();
|
||||
this.result = null;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user