Home | History | Annotate | Download | only in embenchen

Lines Matching refs:FS

58   var nodeFS = require('fs');
1745 var path = (i >= 0) ? arguments[i] : FS.cwd();
1797 // // currently, FS.init does not distinguish if process.stdin is a file or TTY
1800 // // with text files until FS.init can be refactored.
1815 FS.registerDevice(dev, TTY.stream_ops);
1819 throw new FS.ErrnoError(ERRNO_CODES.ENODEV);
1830 throw new FS.ErrnoError(ERRNO_CODES.ENXIO);
1838 throw new FS.ErrnoError(ERRNO_CODES.EIO);
1841 throw new FS.ErrnoError(ERRNO_CODES.EAGAIN);
1853 throw new FS.ErrnoError(ERRNO_CODES.ENXIO);
1859 throw new FS.ErrnoError(ERRNO_CODES.EIO);
1916 if (FS.isBlkdev(mode) || FS.isFIFO(mode)) {
1918 throw new FS.ErrnoError(ERRNO_CODES.EPERM);
1964 stream: FS.chrdev_stream_ops
1968 var node = FS.createNode(parent, name, mode, dev);
1969 if (FS.isDir(node.mode)) {
1973 } else if (FS.isFile(node.mode)) {
1978 } else if (FS.isLink(node.mode)) {
1981 } else if (FS.isChrdev(node.mode)) {
2000 attr.dev = FS
2007 if (FS.isDir(node.mode)) {
2009 } else if (FS.isFile(node.mode)) {
2011 } else if (FS.isLink(node.mode)) {
2038 throw FS.genericErrors[ERRNO_CODES.ENOENT];
2043 if (FS.isDir(old_node.mode)) {
2046 new_node = FS.lookupNode(new_dir, new_name);
2051 throw new FS.ErrnoError(ERRNO_CODES.ENOTEMPTY);
2063 var node = FS.lookupNode(parent, name);
2065 throw new FS.ErrnoError(ERRNO_CODES.ENOTEMPTY);
2082 if (!FS.isLink(node.mode)) {
2083 throw new FS.ErrnoError(ERRNO_CODES.EINVAL);
2128 if (FS.isFile(stream.node.mode)) {
2133 throw new FS.ErrnoError(ERRNO_CODES.EINVAL);
2144 if (!FS.isFile(stream.node.mode)) {
2145 throw new FS.ErrnoError(ERRNO_CODES.ENODEV);
2169 throw new FS.ErrnoError(ERRNO_CODES.ENOMEM);
2243 var check = FS.readdir(mount.mountpoint).filter(isRealDir).map(toAbsolute(mount.mountpoint));
2250 stat = FS.stat(path);
2255 if (FS.isDir(stat.mode)) {
2256 check.push.apply(check, FS.readdir(path).filter(isRealDir).map(toAbsolute(path)));
2291 var lookup = FS.lookupPath(path);
2293 stat = FS.stat(path);
2298 if (FS.isDir(stat.mode)) {
2300 } else if (FS.isFile(stat.mode)) {
2307 if (FS.isDir(entry.mode)) {
2308 FS.mkdir(path, entry.mode);
2309 } else if (FS.isFile(entry.mode)) {
2310 FS.writeFile(path, entry.contents, { encoding: 'binary', canOwn: true });
2315 FS.utime(path, entry.timestamp, entry.timestamp);
2323 var lookup = FS.lookupPath(path);
2324 var stat = FS.stat(path);
2326 if (FS.isDir(stat.mode)) {
2327 FS.rmdir(path);
2328 } else if (FS.isFile(stat.mode)) {
2329 FS.unlink(path);
2429 if (!FS.isDir(mode) && !FS.isFile(mode) && !FS.isLink(mode)) {
2430 throw new FS.ErrnoError(ERRNO_CODES.EINVAL);
2432 var node = FS.createNode(parent, name, mode);
2439 stat = fs.lstatSync(path);
2447 throw new FS.ErrnoError(ERRNO_CODES[e.code]);
2469 stat = fs.lstatSync(path);
2472 throw new FS.ErrnoError(ERRNO_CODES[e.code]);
2501 fs.chmodSync(path, attr.mode);
2507 fs.utimesSync(path, date, date);
2510 fs.truncateSync(path, attr.size);
2514 throw new FS.ErrnoError(ERRNO_CODES[e.code]);
2522 // create the backing node for this in the fs root as well
2525 if (FS.isDir(node.mode)) {
2526 fs.mkdirSync(path, node.mode);
2528 fs.writeFileSync(path, '', { mode: node.mode });
2532 throw new FS.ErrnoError(ERRNO_CODES[e.code]);
2539 fs.renameSync(oldPath, newPath);
2542 throw new FS.ErrnoError(ERRNO_CODES[e.code]);
2547 fs.unlinkSync(path);
2550 throw new FS.ErrnoError(ERRNO_CODES[e.code]);
2555 fs.rmdirSync(path);
2558 throw new FS.ErrnoError(ERRNO_CODES[e.code]);
2563 return fs.readdirSync(path);
2566 throw new FS.ErrnoError(ERRNO_CODES[e.code]);
2571 fs.symlinkSync(oldPath, newPath);
2574 throw new FS.ErrnoError(ERRNO_CODES[e.code]);
2579 return fs.readlinkSync(path);
2582 throw new FS.ErrnoError(ERRNO_CODES[e.code]);
2587 if (FS.isFile(stream.node.mode)) {
2588 stream.nfd = fs.openSync(path, NODEFS.flagsToPermissionString(stream.flags));
2592 throw new FS.ErrnoError(ERRNO_CODES[e.code]);
2596 if (FS.isFile(stream.node.mode) && stream.nfd) {
2597 fs.closeSync(stream.nfd);
2601 throw new FS.ErrnoError(ERRNO_CODES[e.code]);
2608 res = fs.readSync(stream.nfd, nbuffer, 0, length, position);
2610 throw new FS.ErrnoError(ERRNO_CODES[e.code]);
2623 res = fs.writeSync(stream.nfd, nbuffer, 0, length, position);
2625 throw new FS.ErrnoError(ERRNO_CODES[e.code]);
2633 if (FS.isFile(stream.node.mode)) {
2635 var stat = fs.fstatSync(stream.nfd);
2638 throw new FS.ErrnoError(ERRNO_CODES[e.code]);
2644 throw new FS.ErrnoError(ERRNO_CODES.EINVAL);
2661 }var FS={root:null,mounts:[],devices:[null],streams:[],nextInode:1,nameTable:null,currentPath:"/",initialized:false,ignorePermissions:true,ErrnoError:null,genericErrors:{},handleFSError:function (e) {
2662 if (!(e instanceof FS.ErrnoError)) throw e + ' : ' + stackTrace();
2665 path = PATH.resolve(FS.cwd(), path);
2679 throw new FS.ErrnoError(ERRNO_CODES.ELOOP);
2688 var current = FS.root;
2698 current = FS.lookupNode(current, parts[i]);
2702 if (FS.isMountpoint(current)) {
2712 while (FS.isLink(current.mode)) {
2713 var link = FS.readlink(current_path);
2716 var lookup = FS.lookupPath(current_path, { recurse_count: opts.recurse_count });
2720 throw new FS.ErrnoError(ERRNO_CODES.ELOOP);
2730 if (FS.isRoot(node)) {
2745 return ((parentid + hash) >>> 0) % FS.nameTable.length;
2747 var hash = FS.hashName(node.parent.id, node.name);
2748 node.name_next = FS.nameTable[hash];
2749 FS.nameTable[hash] = node;
2751 var hash = FS.hashName(node.parent.id, node.name);
2752 if (FS.nameTable[hash] === node) {
2753 FS.nameTable[hash] = node.name_next;
2755 var current = FS.nameTable[hash];
2765 var err = FS.mayLookup(parent);
2767 throw new FS.ErrnoError(err);
2769 var hash = FS.hashName(parent.id, name);
2770 for (var node = FS.nameTable[hash]; node; node = node.name_next) {
2777 return FS.lookup(parent, name);
2779 if (!FS.FSNode) {
2780 FS.FSNode = function(parent, name, mode, rdev) {
2787 this.id = FS.nextInode++;
2795 FS.FSNode.prototype = {};
2803 Object.defineProperties(FS.FSNode.prototype, {
2813 get: function() { return FS.isDir(this.mode); },
2816 get: function() { return FS.isChrdev(this.mode); },
2821 var node = new FS.FSNode(parent, name, mode, rdev);
2823 FS.hashAddNode(node);
2827 FS.hashRemoveNode(node);
2847 var flags = FS.flagModes[str];
2860 if (FS.ignorePermissions) {
2873 return FS.nodePermissions(dir, 'x');
2876 var node = FS.lookupNode(dir, name);
2880 return FS.nodePermissions(dir, 'wx');
2884 node = FS.lookupNode(dir, name);
2888 var err = FS.nodePermissions(dir, 'wx');
2893 if (!FS.isDir(node.mode)) {
2896 if (FS.isRoot(node) || FS.getPath(node) === FS.cwd()) {
2900 if (FS.isDir(node.mode)) {
2909 if (FS.isLink(node.mode)) {
2911 } else if (FS.isDir(node.mode)) {
2917 return FS.nodePermissions(node, FS.flagsToPermissionString(flags));
2920 fd_end = fd_end || FS.MAX_OPEN_FDS;
2922 if (!FS.streams[fd]) {
2926 throw new FS.ErrnoError(ERRNO_CODES.EMFILE);
2928 return FS.streams[fd];
2930 if (!FS.FSStream) {
2931 FS.FSStream = function(){};
2932 FS.FSStream.prototype = {};
2934 Object.defineProperties(FS.FSStream.prototype, {
2952 stream.__proto__ = FS.FSStream.prototype;
2954 var newStream = new FS.FSStream();
2960 var fd = FS.nextfd(fd_start, fd_end);
2962 FS.streams[fd] = stream;
2965 FS.streams[fd] = null;
2967 return FS.streams[ptr - 1];
2971 var device = FS.getDevice(stream.node.rdev);
2979 throw new FS.ErrnoError(ERRNO_CODES.ESPIPE);
2987 FS.devices[dev] = { stream_ops: ops };
2989 return FS.devices[dev];
3009 var mounts = FS.getMounts(FS.root.mount);
3037 if (root && FS.root) {
3038 throw new FS.ErrnoError(ERRNO_CODES.EBUSY);
3040 var lookup = FS.lookupPath(mountpoint, { follow_mount: false });
3045 if (FS.isMountpoint(node)) {
3046 throw new FS.ErrnoError(ERRNO_CODES.EBUSY);
3049 if (!FS.isDir(node.mode)) {
3050 throw new FS.ErrnoError(ERRNO_CODES.ENOTDIR);
3061 // create a root node for the fs
3067 FS.root = mountRoot;
3080 var lookup = FS.lookupPath(mountpoint, { follow_mount: false });
3082 if (!FS.isMountpoint(lookup.node)) {
3083 throw new FS.ErrnoError(ERRNO_CODES.EINVAL);
3089 var mounts = FS.getMounts(mount);
3091 Object.keys(FS.nameTable).forEach(function (hash) {
3092 var current = FS.nameTable[hash];
3098 FS.destroyNode(current);
3115 var lookup = FS.lookupPath(path, { parent: true });
3118 var err = FS.mayCreate(parent, name);
3120 throw new FS.ErrnoError(err);
3123 throw new FS.ErrnoError(ERRNO_CODES.EPERM);
3130 return FS.mknod(path, mode, 0);
3135 return FS.mknod(path, mode, 0);
3142 return FS.mknod(path, mode, dev);
3144 var lookup = FS.lookupPath(newpath, { parent: true });
3147 var err = FS.mayCreate(parent, newname);
3149 throw new FS.ErrnoError(err);
3152 throw new FS.ErrnoError(ERRNO_CODES.EPERM);
3163 lookup = FS.lookupPath(old_path, { parent: true });
3165 lookup = FS.lookupPath(new_path, { parent: true });
3168 throw new FS.ErrnoError(ERRNO_CODES.EBUSY);
3172 throw new FS.ErrnoError(ERRNO_CODES.EXDEV);
3175 var old_node = FS.lookupNode(old_dir, old_name);
3179 throw new FS.ErrnoError(ERRNO_CODES.EINVAL);
3184 throw new FS.ErrnoError(ERRNO_CODES.ENOTEMPTY);
3189 new_node = FS.lookupNode(new_dir, new_name);
3198 var isdir = FS.isDir(old_node.mode);
3199 var err = FS.mayDelete(old_dir, old_name, isdir);
3201 throw new FS.ErrnoError(err);
3206 FS.mayDelete(new_dir, new_name, isdir) :
3207 FS.mayCreate(new_dir, new_name);
3209 throw new FS.ErrnoError(err);
3212 throw new FS.ErrnoError(ERRNO_CODES.EPERM);
3214 if (FS.isMountpoint(old_node) || (new_node && FS.isMountpoint(new_node))) {
3215 throw new FS.ErrnoError(ERRNO_CODES.EBUSY);
3219 err = FS.nodePermissions(old_dir, 'w');
3221 throw new FS.ErrnoError(err);
3225 FS.hashRemoveNode(old_node);
3226 // do the underlying fs rename
3234 FS.hashAddNode(old_node);
3237 var lookup = FS.lookupPath(path, { parent: true });
3240 var node = FS.lookupNode(parent, name);
3241 var err = FS.mayDelete(parent, name, true);
3243 throw new FS.ErrnoError(err);
3246 throw new FS.ErrnoError(ERRNO_CODES.EPERM);
3248 if (FS.isMountpoint(node)) {
3249 throw new FS.ErrnoError(ERRNO_CODES.EBUSY);
3252 FS.destroyNode(node);
3254 var lookup = FS.lookupPath(path, { follow: true });
3257 throw new FS.ErrnoError(ERRNO_CODES.ENOTDIR);
3261 var lookup = FS.lookupPath(path, { parent: true });
3264 var node = FS.lookupNode(parent, name);
3265 var err = FS.mayDelete(parent, name, false);
3269 throw new FS.ErrnoError(err);
3272 throw new FS.ErrnoError(ERRNO_CODES.EPERM);
3274 if (FS.isMountpoint(node)) {
3275 throw new FS.ErrnoError(ERRNO_CODES.EBUSY);
3278 FS.destroyNode(node);
3280 var lookup = FS.lookupPath(path);
3283 throw new FS.ErrnoError(ERRNO_CODES.EINVAL);
3287 var lookup = FS.lookupPath(path, { follow: !dontFollow });
3290 throw new FS.ErrnoError(ERRNO_CODES.EPERM);
3294 return FS.stat(path, true);
3298 var lookup = FS.lookupPath(path, { follow: !dontFollow });
3304 throw new FS.ErrnoError(ERRNO_CODES.EPERM);
3311 FS.chmod(path, mode, true);
3313 var stream = FS.getStream(fd);
3315 throw new FS.ErrnoError(ERRNO_CODES.EBADF);
3317 FS.chmod(stream.node, mode);
3321 var lookup = FS.lookupPath(path, { follow: !dontFollow });
3327 throw new FS.ErrnoError(ERRNO_CODES.EPERM);
3334 FS.chown(path, uid, gid, true);
3336 var stream = FS.getStream(fd);
3338 throw new FS.ErrnoError(ERRNO_CODES.EBADF);
3340 FS.chown(stream.node, uid, gid);
3343 throw new FS.ErrnoError(ERRNO_CODES.EINVAL);
3347 var lookup = FS.lookupPath(path, { follow: true });
3353 throw new FS.ErrnoError(ERRNO_CODES.EPERM);
3355 if (FS.isDir(node.mode)) {
3356 throw new FS.ErrnoError(ERRNO_CODES.EISDIR);
3358 if (!FS.isFile(node.mode)) {
3359 throw new FS.ErrnoError(ERRNO_CODES.EINVAL);
3361 var err = FS.nodePermissions(node, 'w');
3363 throw new FS.ErrnoError(err);
3370 var stream = FS.getStream(fd);
3372 throw new FS.ErrnoError(ERRNO_CODES.EBADF);
3375 throw new FS.ErrnoError(ERRNO_CODES.EINVAL);
3377 FS.truncate(stream.node, len);
3379 var lookup = FS.lookupPath(path, { follow: true });
3385 flags = typeof flags === 'string' ? FS.modeStringToFlags(flags) : flags;
3398 var lookup = FS.lookupPath(path, {
3411 throw new FS.ErrnoError(ERRNO_CODES.EEXIST);
3415 node = FS.mknod(path, mode, 0);
3419 throw new FS.ErrnoError(ERRNO_CODES.ENOENT);
3422 if (FS.isChrdev(node.mode)) {
3426 var err = FS.mayOpen(node, flags);
3428 throw new FS.ErrnoError(err);
3432 FS.truncate(node, 0);
3438 var stream = FS.createStream({
3440 path: FS.getPath(node), // we want the absolute path to the node
3454 if (!FS.readFiles) FS.readFiles = {};
3455 if (!(path in FS.readFiles)) {
3456 FS.readFiles[path] = 1;
3469 FS.closeStream(stream.fd);
3473 throw new FS.ErrnoError(ERRNO_CODES.ESPIPE);
3478 throw new FS.ErrnoError(ERRNO_CODES.EINVAL);
3481 throw new FS.ErrnoError(ERRNO_CODES.EBADF);
3483 if (FS.isDir(stream.node.mode)) {
3484 throw new FS.ErrnoError(ERRNO_CODES.EISDIR);
3487 throw new FS.ErrnoError(ERRNO_CODES.EINVAL);
3494 throw new FS.ErrnoError(ERRNO_CODES.ESPIPE);
3501 throw new FS.ErrnoError(ERRNO_CODES.EINVAL);
3504 throw new FS.ErrnoError(ERRNO_CODES.EBADF);
3506 if (FS.isDir(stream.node.mode)) {
3507 throw new FS.ErrnoError(ERRNO_CODES.EISDIR);
3510 throw new FS.ErrnoError(ERRNO_CODES.EINVAL);
3517 throw new FS.ErrnoError(ERRNO_CODES.ESPIPE);
3521 FS.llseek(stream, 0, 2);
3528 throw new FS.ErrnoError(ERRNO_CODES.EINVAL);
3531 throw new FS.ErrnoError(ERRNO_CODES.EBADF);
3533 if (!FS.isFile(stream.node.mode) && !FS.isDir(node.mode)) {
3534 throw new FS.ErrnoError(ERRNO_CODES.ENODEV);
3537 throw new FS.ErrnoError(ERRNO_CODES.EOPNOTSUPP);
3543 throw new FS.ErrnoError(ERRNO_CODES.EACCES);
3546 throw new FS.ErrnoError(ERRNO_CODES.ENODEV);
3551 throw new FS.ErrnoError(ERRNO_CODES.ENOTTY);
3562 var stream = FS.open(path, opts.flags);
3563 var stat = FS.stat(path);
3566 FS.read(stream, buf, 0, length, 0);
3576 FS.close(stream);
3585 var stream = FS.open(path, opts.flags, opts.mode);
3589 FS.write(stream, buf, 0, buf.length, 0, opts.canOwn);
3591 FS.write(stream, data, 0, data.length, 0, opts.canOwn);
3593 FS.close(stream);
3595 return FS.currentPath;
3597 var lookup = FS.lookupPath(path, { follow: true });
3598 if (!FS.isDir(lookup.node.mode)) {
3599 throw new FS.ErrnoError(ERRNO_CODES.ENOTDIR);
3601 var err = FS.nodePermissions(lookup.node, 'x');
3603 throw new FS.ErrnoError(err);
3605 FS.currentPath = lookup.path;
3607 FS.mkdir('/tmp');
3610 FS.mkdir('/dev');
3612 FS.registerDevice(FS.makedev(1, 3), {
3616 FS.mkdev('/dev/null', FS.makedev(1, 3));
3620 TTY.register(FS.makedev(5, 0), TTY.default_tty_ops);
3621 TTY.register(FS.makedev(6, 0), TTY.default_tty1_ops);
3622 FS.mkdev('/dev/tty', FS.makedev(5, 0));
3623 FS.mkdev('/dev/tty1', FS.makedev(6, 0));
3626 FS.mkdir('/dev/shm');
3627 FS.mkdir('/dev/shm/tmp');
3630 // input / output callback and that utilizes FS.createDevice
3638 FS.createDevice('/dev', 'stdin', Module['stdin']);
3640 FS.symlink('/dev/tty', '/dev/stdin');
3643 FS.createDevice('/dev', 'stdout', null, Module['stdout']);
3645 FS.symlink('/dev/tty', '/dev/stdout');
3648 FS.createDevice('/dev', 'stderr', null, Module['stderr']);
3650 FS.symlink('/dev/tty1', '/dev/stderr');
3654 var stdin = FS.open('/dev/stdin', 'r');
3655 HEAP32[((_stdin)>>2)]=FS.getPtrForStream(stdin);
3658 var stdout = FS.open('/dev/stdout', 'w');
3659 HEAP32[((_stdout)>>2)]=FS.getPtrForStream(stdout);
3662 var stderr = FS.open('/dev/stderr', 'w');
3663 HEAP32[((_stderr)>>2)]=FS.getPtrForStream(stderr);
3666 if (FS.ErrnoError) return;
3667 FS.ErrnoError = function ErrnoError(errno) {
3677 FS.ErrnoError.prototype = new Error();
3678 FS.ErrnoError.prototype.constructor = FS.ErrnoError;
3681 FS.genericErrors[code] = new FS.ErrnoError(code);
3682 FS.genericErrors[code].stack = '<generic error, no stack>';
3685 FS.ensureErrnoError();
3687 FS.nameTable = new Array(4096);
3689 FS.mount(MEMFS, {}, '/');
3691 FS.createDefaultDirectories();
3692 FS.createDefaultDevices();
3694 assert(!FS.init.initialized, 'FS.init was previously called. If you want to initialize later with custom parameters, remove any earlier calls (note that one is automatically added to the generated code)');
3695 FS.init.initialized = true;
3697 FS.ensureErrnoError();
3704 FS.createStandardStreams();
3706 FS.init.initialized = false;
3707 for (var i = 0; i < FS.streams.length; i++) {
3708 var stream = FS.streams[i];
3712 FS.close(stream);
3728 var ret = FS.analyzePath(path, dontResolveLastLink);
3738 var lookup = FS.lookupPath(path, { follow: !dontResolveLastLink });
3747 var lookup = FS.lookupPath(path, { parent: true });
3752 lookup = FS.lookupPath(path, { follow: !dontResolveLastLink });
3763 var path = PATH.join2(typeof parent === 'string' ? parent : FS.getPath(parent), name);
3764 var mode = FS.getMode(canRead, canWrite);
3765 return FS.mkdir(path, mode);
3767 parent = typeof parent === 'string' ? parent : FS.getPath(parent);
3774 FS.mkdir(current);
3782 var path = PATH.join2(typeof parent === 'string' ? parent : FS.getPath(parent), name);
3783 var mode = FS.getMode(canRead, canWrite);
3784 return FS.create(path, mode);
3786 var path = name ? PATH.join2(typeof parent === 'string' ? parent : FS.getPath(parent), name) : parent;
3787 var mode = FS.getMode(canRead, canWrite);
3788 var node = FS.create(path, mode);
3796 FS.chmod(node, mode | 146);
3797 var stream = FS.open(node, 'w');
3798 FS.write(stream, data, 0, data.length, 0, canOwn);
3799 FS.close(stream);
3800 FS.chmod(node, mode);
3804 var path = PATH.join2(typeof parent === 'string' ? parent : FS.getPath(parent), name);
3805 var mode = FS.getMode(!!input, !!output);
3806 if (!FS.createDevice.major) FS
3807 var dev = FS.makedev(FS.createDevice.major++, 0);
3810 FS.registerDevice(dev, {
3827 throw new FS.ErrnoError(ERRNO_CODES.EIO);
3830 throw new FS.ErrnoError(ERRNO_CODES.EAGAIN);
3846 throw new FS.ErrnoError(ERRNO_CODES.EIO);
3855 return FS.mkdev(path, mode, dev);
3857 var path = PATH.join2(typeof parent === 'string' ? parent : FS.getPath(parent), name);
3858 return FS.symlink(target, path);
3973 var node = FS.createFile(parent, name, properties, canRead, canWrite);
3989 if (!FS.forceLoadFile(node)) {
3990 throw new FS.ErrnoError(ERRNO_CODES.EIO);
3997 if (!FS.forceLoadFile(node)) {
3998 throw new FS.ErrnoError(ERRNO_CODES.EIO);
4026 FS.createDataFile(parent, name, byteArray, canRead, canWrite, canOwn);
4059 var indexedDB = FS.indexedDB();
4061 var openRequest = indexedDB.open(FS.DB_NAME(), FS.DB_VERSION);
4068 db.createObjectStore(FS.DB_STORE_NAME);
4072 var transaction = db.transaction([FS.DB_STORE_NAME], 'readwrite');
4073 var files = transaction.objectStore(FS.DB_STORE_NAME);
4079 var putRequest = files.put(FS.analyzePath(path).object.contents, path);
4089 var indexedDB = FS.indexedDB();
4091 var openRequest = indexedDB.open(FS.DB_NAME(), FS.DB_VERSION);
4099 var transaction = db.transaction([FS.DB_STORE_NAME], 'readonly');
4104 var files = transaction.objectStore(FS.DB_STORE_NAME);
4112 if (FS.analyzePath(path).exists) {
4113 FS.unlink(path);
4115 FS.createDataFile(PATH.dirname(path), PATH.basename(path), getRequest.result, true, true, true);
4130 return FS.createNode(null, '/', 16384 | 511 /* 0777 */, 0);
4151 var node = FS.createNode(SOCKFS.root, name, 49152, 0);
4156 var stream = FS.createStream({
4159 flags: FS.modeStringToFlags('r+'),
4170 var stream = FS.getStream(fd);
4171 if (!stream || !FS.isSocket(stream.node.mode)) {
4268 throw new FS.ErrnoError(ERRNO_CODES.EHOSTUNREACH);
4422 throw new FS.ErrnoError(ERRNO_CODES.EINVAL); // already bound
4440 if (!(e instanceof FS.ErrnoError)) throw e;
4446 throw new FS.ErrnoError(ERRNO_CODS.EOPNOTSUPP);
4458 throw new FS.ErrnoError(ERRNO_CODES.EALREADY);
4460 throw new FS.ErrnoError(ERRNO_CODES.EISCONN);
4472 throw new FS.ErrnoError(ERRNO_CODES.EINPROGRESS);
4475 throw new FS.ErrnoError(ERRNO_CODES.EOPNOTSUPP);
4478 throw new FS.ErrnoError(ERRNO_CODES.EINVAL); // already listening
4514 throw new FS.ErrnoError(ERRNO_CODES.EINVAL);
4523 throw new FS.ErrnoError(ERRNO_CODES.ENOTCONN);
4544 throw new FS.ErrnoError(ERRNO_CODES.EDESTADDRREQ);
4558 throw new FS.ErrnoError(ERRNO_CODES.ENOTCONN);
4560 throw new FS.ErrnoError(ERRNO_CODES.EAGAIN);
4593 throw new FS.ErrnoError(ERRNO_CODES.EINVAL);
4599 throw new FS.ErrnoError(ERRNO_CODES.ENOTCONN);
4609 throw new FS.ErrnoError(ERRNO_CODES.ENOTCONN);
4617 throw new FS.ErrnoError(ERRNO_CODES.EAGAIN);
4620 throw new FS.ErrnoError(ERRNO_CODES.EAGAIN);
4658 var stream = FS.getStream(fildes);
4665 return FS.write(stream, slab, buf, nbyte, offset);
4667 FS.handleFSError(e);
4673 var stream = FS.getStream(fildes);
4682 return FS.write(stream, slab, buf, nbyte);
4684 FS.handleFSError(e);
4692 stream = FS.getStreamFromPtr(stream);
4703 var streamObj = FS.getStreamFromPtr(stream);
5143 var streamObj = FS.getStreamFromPtr(stream);
5899 FS.staticInit();__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() } });Module["FS_createFolder"] = FS.createFolder;Module["FS_createPath"] = FS.createPath;Module["FS_createDataFile"] = FS.createDataFile;Module["FS_createPreloadedFile"] = FS.createPreloadedFile;Module["FS_createLazyFile"] = FS.createLazyFile;Module["FS_createLink"] = FS.createLink;Module["FS_createDevice"] = FS.createDevice;
5902 if (ENVIRONMENT_IS_NODE) { var fs = require("fs"); NODEFS.staticInit(); }
5903 __ATINIT__.push({ func: function() { SOCKFS.root = FS.mount(SOCKFS, {}, null); } });