filer/examples/idbfs-test.html

52 lines
1.0 KiB
HTML
Raw Normal View History

2012-10-07 05:42:58 +00:00
<!DOCTYPE HTML>
<html>
<head>
<meta charset="utf-8" />
</head>
2012-10-11 06:20:58 +00:00
<body>
<div id="stdout"></div>
</body>
2012-10-07 05:42:58 +00:00
<script src="../lib/require.js"></script>
<script>
require.config({
baseUrl: "../lib",
paths: {
"src": "../src"
}
});
2012-11-08 05:12:41 +00:00
require(["src/fs"], function(IDBFS) {
2012-10-11 06:20:58 +00:00
2012-11-08 05:12:41 +00:00
IDBFS.mount("default", "FORMAT", function(error, fs) {
if(error) {
2012-11-09 16:10:55 +00:00
return console.error(error);
2012-11-08 05:12:41 +00:00
}
fs.mkdir("/tmp", function() {
if(error) {
2012-11-09 16:10:55 +00:00
return console.error(error);
}
fs.stat("/tmp", function(error, result) {
if(error) {
2012-11-09 16:10:55 +00:00
return console.error(error);
}
console.info(result);
2012-11-09 16:10:55 +00:00
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");
});
});
});
2012-10-11 06:20:58 +00:00
});
2012-11-08 05:12:41 +00:00
});
2012-10-11 06:20:58 +00:00
2012-10-07 05:42:58 +00:00
});
</script>
2012-10-15 15:33:56 +00:00
</html>