aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlon Zakai <alonzakai@gmail.com>2012-06-11 10:46:31 -0700
committerAlon Zakai <alonzakai@gmail.com>2012-06-11 10:46:31 -0700
commitfa3225e331ff307ae157410606d101bf72aa316a (patch)
tree7bdc9a3c98f8a14055c88be8ec8b416db2e75540
parent41a99b287182ea2870d51665c224ef6c315132ab (diff)
export some filesystem commands through closure
-rw-r--r--src/library.js9
-rwxr-xr-xtests/runner.py3
2 files changed, 10 insertions, 2 deletions
diff --git a/src/library.js b/src/library.js
index 9ebe926a..cd18b566 100644
--- a/src/library.js
+++ b/src/library.js
@@ -28,7 +28,14 @@ LibraryManager.library = {
$FS__deps: ['$ERRNO_CODES', '__setErrNo', 'stdin', 'stdout', 'stderr', '_impure_ptr'],
$FS__postset: '__ATINIT__.unshift({ func: function() { if (!Module["noFSInit"] && !FS.init.initialized) FS.init() } });' +
'__ATMAIN__.push({ func: function() { FS.ignorePermissions = false } });' +
- '__ATEXIT__.push({ func: function() { FS.quit() } });',
+ '__ATEXIT__.push({ func: function() { FS.quit() } });' +
+ // export some names through closure
+ 'Module["FS_createFolder"] = FS.createFolder;' +
+ 'Module["FS_createPath"] = FS.createPath;' +
+ 'Module["FS_createDataFile"] = FS.createDataFile;' +
+ 'Module["FS_createLazyFile"] = FS.createLazyFile;' +
+ 'Module["FS_createLink"] = FS.createLink;' +
+ 'Module["FS_createDevice"] = FS.createDevice;',
$FS: {
// The path to the current folder.
currentPath: '/',
diff --git a/tests/runner.py b/tests/runner.py
index 779e51da..f8824578 100755
--- a/tests/runner.py
+++ b/tests/runner.py
@@ -4023,8 +4023,9 @@ def process(filename):
var Module = {
'noFSInit': true,
'preRun': function() {
- FS.createDataFile('/', 'somefile.binary', [100, 200, 50, 25, 10, 77, 123], true, false); // 200 becomes -56, since signed chars are used in memory
FS.createLazyFile('/', 'test.file', 'test.file', true, false);
+ // Test FS_* exporting
+ Module['FS_createDataFile']('/', 'somefile.binary', [100, 200, 50, 25, 10, 77, 123], true, false); // 200 becomes -56, since signed chars are used in memory
var test_files_input = 'hi there!';
var test_files_input_index = 0;
FS.init(function() {