Created
January 29, 2012 02:36
-
-
Save d2m/1696850 to your computer and use it in GitHub Desktop.
Read/write files server-side under frogsh/minfrog
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
/** | |
* location: dart/frog/file_system_node.dart | |
* library: file_system_node | |
* class: NodeFileSystem | |
* File system implementation using nodejs api's (for self-hosted compiler). | |
*/ | |
#import('../../frog/file_system_node.dart'); | |
NodeFileSystem _fs = new NodeFileSystem(); | |
// Read a file (uses readFileSync()) | |
String filename = 'name.ext'; | |
String filecontents = _fs.readAll(filename); | |
// Write a file (uses writeFileSync()) | |
String filecontents = '...'; | |
_fs.writeString(filename, filecontents); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment