function File() {
}
File.prototype.foo = ...;
exports.createFile = ...;
exports.File = File;
// ...
var myfs=require('FileSystem');
myfs.File.prototype.mySpecialFunction = ...;
var file=myfs.createFile('test.txt');
In fact, in a lot of cases you don't actually need access to the File class directly, since it'll only be created by things like createFile.
If you're doing this, please can you make your API the same as the existing filesystem - specifically the existing E.openFile function? It'd make life much easier for everyone.
... IMO it'd be ideal if someone could just compile all the existing FAT filesystem code into the ESP8266 port, and then it could even work with external SD cards if needed. While not perfect for flash memory, I'm sure it'd be good enough.
Espruino is a JavaScript interpreter for low-power Microcontrollers. This site is both a support community for Espruino and a place to share what you are working on.
I'd put them both in one module:
In fact, in a lot of cases you don't actually need access to the
File
class directly, since it'll only be created by things likecreateFile
.If you're doing this, please can you make your API the same as the existing filesystem - specifically the existing
E.openFile
function? It'd make life much easier for everyone.... IMO it'd be ideal if someone could just compile all the existing FAT filesystem code into the ESP8266 port, and then it could even work with external SD cards if needed. While not perfect for flash memory, I'm sure it'd be good enough.