filer/examples/idbfs-test.html

52 lines
1.0 KiB
HTML

<!DOCTYPE HTML>
<html>
<head>
<meta charset="utf-8" />
</head>
<body>
<div id="stdout"></div>
</body>
<script src="../lib/require.js"></script>
<script>
require.config({
baseUrl: "../lib",
paths: {
"src": "../src"
}
});
require(["src/fs"], function(IDBFS) {
IDBFS.mount("default", "FORMAT", function(error, fs) {
if(error) {
return console.error(error);
}
fs.mkdir("/tmp", function() {
if(error) {
return console.error(error);
}
fs.stat("/tmp", function(error, result) {
if(error) {
return console.error(error);
}
console.info(result);
fs.open("/tmp/0", "create", "rw", function(error, fd) {
if(error) {
return console.error(error);
}
console.info(fd._openfile._handle);
fs.close(fd, function(error) {
if(error) {
return console.error(error);
}
console.info("done");
});
});
});
});
});
});
</script>
</html>