36 lines
767 B
HTML
36 lines
767 B
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/filesystem"], function(IDBFS) {
|
|
|
|
IDBFS.mount("default", function(error, fs) {
|
|
fs.mkdir("/tmp", function(error) {
|
|
fs.open("/tmp/0", "CREATE", "RW", function(error, fd) {
|
|
fs.close(fd, function(error) {
|
|
fs.dump(document.getElementById("stdout"));
|
|
var buffer = new Uint8Array(16);
|
|
fd.read(buffer, 0, 16, function(error, bytes_read, buffer) {
|
|
console.log(error, bytes_read);
|
|
});
|
|
});
|
|
});
|
|
});
|
|
}, true);
|
|
|
|
});
|
|
</script>
|
|
</html> |