BoneScript

Did you know? This page can interact with your BeagleBone
Type in your BeagleBone's IP address here:
Type in your BeagleBone's IP address here:
You might be able to see a newer version of this on beagleboard.org/support/bonescript/readTextFile
readTextFile(filename, [callback])
Read the contents of a text (ASCII) file.
Arguments
- filename: complete path of the file to be read
- callback: called upon completion
Return value
- File contents in a single string
callback(err,data)
- data: file contents
- err: error status message
Example
123456var b = require('bonescript');b.readTextFile('/etc/dogtag', printStatus);function printStatus(err,data) {console.log('data = ' + data);console.log('err = ' + err);}
Build and execute instructions
- Adjust the file name to read other files and execute the example code.