Updated examples.
This commit is contained in:
parent
cb370a0ede
commit
be724d2b24
|
@ -1,45 +0,0 @@
|
|||
<!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/buffer"], function(Buffer) {
|
||||
|
||||
try {
|
||||
/*
|
||||
var string1 = "\u00BD + \u00BC";
|
||||
var string2 = " = \u00BE";
|
||||
var buffer1 = new Buffer(string1);
|
||||
var buffer2 = new Buffer(string2);
|
||||
console.log(buffer1.toString(), ";", buffer2.toString());
|
||||
var buffer3 = Buffer.concat([buffer1, buffer2]);
|
||||
console.log(buffer3.toString());
|
||||
var buffer4 = buffer3.slice(0, 7);
|
||||
console.log(buffer4.toString());
|
||||
*/
|
||||
var buffer = new Buffer(4);
|
||||
buffer.writeUInt32LE(0xDEADBEEF, 0);
|
||||
console.log(0xDEADBEEF | 0x0);
|
||||
console.log(buffer.readUInt32LE(0));
|
||||
buffer.writeUInt32BE(0xDEADBEEF, 0);
|
||||
console.log(buffer.readUInt32BE(0));
|
||||
// console.log(buffer.readUInt16LE(0));
|
||||
} catch(e) {
|
||||
console.log(e);
|
||||
}
|
||||
|
||||
});
|
||||
</script>
|
||||
</html>
|
|
@ -15,7 +15,7 @@ require.config({
|
|||
}
|
||||
});
|
||||
|
||||
require(["src/filesystem", "src/buffer"], function(IDBFS, Buffer) {
|
||||
require(["src/filesystem"], function(IDBFS) {
|
||||
|
||||
IDBFS.mount("default", function(error, fs) {
|
||||
fs.mkdir("/tmp", function(error) {
|
||||
|
|
Loading…
Reference in New Issue