Writting to the storage
This commit is contained in:
1 parent
600c79506b
commit
3295e91d5f
6 files changed
+154
-70
No files matched your search
@@ -0,0 +1,71 @@
|
||||
function newWebFS() {
|
||||
|
||||
const MODULE_NAME = "Web FS";
|
||||
const INFO_LOG = false;
|
||||
const ERROR_LOG = true;
|
||||
const logger = newWebDebugLog();
|
||||
logger.fileName = MODULE_NAME;
|
||||
|
||||
/*
|
||||
|
||||
This is the module emulates the NodeJS 'fs'.
|
||||
|
||||
*/
|
||||
|
||||
var thisObject = {
|
||||
readFileSync: readFileSync,
|
||||
appendFileSync: appendFileSync,
|
||||
mkdirSync: mkdirSync,
|
||||
statSync: statSync,
|
||||
readdir: readdir,
|
||||
readdirSync: readdirSync,
|
||||
readFile: readFile
|
||||
};
|
||||
|
||||
|
||||
return thisObject;
|
||||
|
||||
function readFileSync(pPath, pEncoding) {
|
||||
|
||||
switch (pPath) {
|
||||
|
||||
case '': {
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function appendFileSync(pPath, pText) {
|
||||
|
||||
/* We will ignore this since we can not and dont want to really write something on disk while we are at the browser. */
|
||||
}
|
||||
|
||||
function readdir(pPath, callBackFunction) {
|
||||
|
||||
/* We will return an empty array of files. */
|
||||
callBackFunction([]);
|
||||
}
|
||||
|
||||
function readdirSync(pPath, callBackFunction) {
|
||||
|
||||
|
||||
}
|
||||
|
||||
function mkdirSync(pPath) {
|
||||
|
||||
/* Again we do nothing. */
|
||||
}
|
||||
|
||||
function readFile(pPath) {
|
||||
|
||||
/* Again we do nothing. */
|
||||
}
|
||||
|
||||
function statSync(pPath) {
|
||||
|
||||
let stats
|
||||
stats.size = 0;
|
||||
return stats
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user