Skip to content

Instantly share code, notes, and snippets.

@muhqu
Created February 16, 2011 08:35
Show Gist options
  • Save muhqu/829042 to your computer and use it in GitHub Desktop.
Save muhqu/829042 to your computer and use it in GitHub Desktop.
<3
{ topic: function () {
fs.stat('~/FILE', this.callback);
},
'after a successful `fs.stat`': {
topic: function (stat) {
fs.open('~/FILE', "r", stat.mode, this.callback);
},
'after a successful `fs.open`': {
topic: function (fd, stat) {
fs.read(fd, stat.size, 0, "utf8", this.callback);
},
'we can `fs.read` to get the file contents': function (data) {
assert.isString (data);
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment