Last active
August 29, 2015 14:14
-
-
Save MadcapJake/9392dc6e19759c2b4a83 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
shared dynamic Buffer { | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import io.nodejs.buffer { Buffer } | |
dynamic FS { | |
"Asynchronously append data to a file, creating the file if it not yet | |
exists. data can be a string or a buffer. | |
JS example: | |
fs.appendFile('message.txt', 'data to append', function (err) { | |
if (err) throw err; | |
console.log('The \"data to append\" was appended to file!'); | |
}); | |
The `options` object can have these three options: | |
* `encoding` String | Null default = 'utf8' | |
* `mode` Number default = 438 (aka 0666 in Octal) | |
* `flag` String default = 'a'" | |
shared formal void appendFile(String filename, String|Buffer data, Object? options, Callable<Object, [Anything]> callback); | |
"The synchronous version of [[FS.appendFile]]" | |
shared formal void appendFileSync(String filename, String|Buffer data, Object? options); | |
} | |
FS requireFS() { | |
dynamic { return require("fs"); } | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Sweet! I'm on the right track then! Thanks for the speedy reply!