1
FS.createFolder('/', 'forbidden', false, false);
2
FS.createFolder('/forbidden', 'test', true, true);
3
FS.createPath('/', 'abc/123', true, true);
4
FS.createPath('/', 'abc/456', true, true);
5
FS.createPath('/', 'def/789', true, true);
6
FS.createDevice('/abc', 'deviceA', function() {}, function() {});
7
FS.createDevice('/def', 'deviceB', function() {}, function() {});
8
FS.createLink('/abc', 'localLink', '123', true, true);
9
FS.createLink('/abc', 'rootLink', '/', true, true);
10
FS.createLink('/abc', 'relativeLink', '../def', true, true);
12
function explore(path) {
14
var ret = FS.analyzePath(path);
15
Module.print(' isRoot: ' + ret.isRoot);
16
Module.print(' exists: ' + ret.exists);
17
Module.print(' error: ' + ret.error);
18
Module.print(' path: ' + ret.path);
19
Module.print(' name: ' + ret.name);
20
Module.print(' object.contents: ' + (ret.object && JSON.stringify(Object.keys(ret.object.contents || {}))));
21
Module.print(' parentExists: ' + ret.parentExists);
22
Module.print(' parentPath: ' + ret.parentPath);
23
Module.print(' parentObject.contents: ' + (ret.parentObject && JSON.stringify(Object.keys(ret.parentObject.contents))));
27
FS.currentPath = '/abc';
35
explore('/abc/noexist');
36
explore('/abc/deviceA');
37
explore('/abc/localLink');
38
explore('/abc/rootLink');
39
explore('/abc/relativeLink');
40
explore('/abc/relativeLink/deviceB');
41
explore('/abc/rootLink/noexist');
42
explore('/abc/rootLink/abc/noexist');
43
explore('/forbidden');
44
explore('/forbidden/test');
45
explore('/forbidden/noexist');
46
explore('/noexist1/noexist2');