Home | History | Annotate | Download | only in embenchen

Lines Matching refs:FS

57   var nodeFS = require('fs');
1496 var path = (i >= 0) ? arguments[i] : FS.cwd();
1548 // // currently, FS.init does not distinguish if process.stdin is a file or TTY
1551 // // with text files until FS.init can be refactored.
1566 FS.registerDevice(dev, TTY.stream_ops);
1570 throw new FS.ErrnoError(ERRNO_CODES.ENODEV);
1581 throw new FS.ErrnoError(ERRNO_CODES.ENXIO);
1589 throw new FS.ErrnoError(ERRNO_CODES.EIO);
1592 throw new FS.ErrnoError(ERRNO_CODES.EAGAIN);
1604 throw new FS.ErrnoError(ERRNO_CODES.ENXIO);
1610 throw new FS.ErrnoError(ERRNO_CODES.EIO);
1667 if (FS.isBlkdev(mode) || FS.isFIFO(mode)) {
1669 throw new FS.ErrnoError(ERRNO_CODES.EPERM);
1715 stream: FS.chrdev_stream_ops
1719 var node = FS.createNode(parent, name, mode, dev);
1720 if (FS.isDir(node.mode)) {
1724 } else if (FS.isFile(node.mode)) {
1729 } else if (FS.isLink(node.mode)) {
1732 } else if (FS.isChrdev(node.mode)) {
1751 attr.dev = FS.isChrdev(node.mode) ? node.id : 1;
1758 if (FS.isDir(node.mode)) {
1760 } else if (FS.isFile(node.mode)) {
1762 } else if (FS.isLink(node.mode)) {
1789 throw FS.genericErrors[ERRNO_CODES.ENOENT];
1794 if (FS.isDir(old_node.mode)) {
1797 new_node = FS.lookupNode(new_dir, new_name);
1802 throw new FS.ErrnoError(ERRNO_CODES.ENOTEMPTY);
1814 var node = FS.lookupNode(parent, name);
1816 throw new FS.ErrnoError(ERRNO_CODES.ENOTEMPTY);
1833 if (!FS.isLink(node.mode)) {
1834 throw new FS.ErrnoError(ERRNO_CODES.EINVAL);
1879 if (FS.isFile(stream.node.mode)) {
1884 throw new FS.ErrnoError(ERRNO_CODES.EINVAL);
1895 if (!FS.isFile(stream.node.mode)) {
1896 throw new FS.ErrnoError(ERRNO_CODES.ENODEV);
1920 throw new FS.ErrnoError(ERRNO_CODES.ENOMEM);
1994 var check = FS.readdir(mount.mountpoint).filter(isRealDir).map(toAbsolute(mount.mountpoint));
2001 stat = FS.stat(path);
2006 if (FS.isDir(stat.mode)) {
2007 check.push.apply(check, FS.readdir(path).filter(isRealDir).map(toAbsolute(path)));
2042 var lookup = FS.lookupPath(path);
2044 stat = FS.stat(path);
2049 if (FS.isDir(stat.mode)) {
2051 } else if (FS.isFile(stat.mode)) {
2058 if (FS.isDir(entry.mode)) {
2059 FS.mkdir(path, entry.mode);
2060 } else if (FS.isFile(entry.mode)) {
2061 FS.writeFile(path, entry.contents, { encoding: 'binary', canOwn: true });
2066 FS.utime(path, entry.timestamp, entry.timestamp);
2074 var lookup = FS.lookupPath(path);
2075 var stat = FS.stat(path);
2077 if (FS.isDir(stat.mode)) {
2078 FS.rmdir(path);
2079 } else if (FS.isFile(stat.mode)) {
2080 FS.unlink(path);
2180 if (!FS.isDir(mode) && !FS.isFile(mode) && !FS.isLink(mode)) {
2181 throw new FS
2183 var node = FS.createNode(parent, name, mode);
2190 stat = fs.lstatSync(path);
2198 throw new FS.ErrnoError(ERRNO_CODES[e.code]);
2220 stat = fs.lstatSync(path);
2223 throw new FS.ErrnoError(ERRNO_CODES[e.code]);
2252 fs.chmodSync(path, attr.mode);
2258 fs.utimesSync(path, date, date);
2261 fs.truncateSync(path, attr.size);
2265 throw new FS.ErrnoError(ERRNO_CODES[e.code]);
2273 // create the backing node for this in the fs root as well
2276 if (FS.isDir(node.mode)) {
2277 fs.mkdirSync(path, node.mode);
2279 fs.writeFileSync(path, '', { mode: node.mode });
2283 throw new FS.ErrnoError(ERRNO_CODES[e.code]);
2290 fs.renameSync(oldPath, newPath);
2293 throw new FS.ErrnoError(ERRNO_CODES[e.code]);
2298 fs.unlinkSync(path);
2301 throw new FS.ErrnoError(ERRNO_CODES[e.code]);
2306 fs.rmdirSync(path);
2309 throw new FS.ErrnoError(ERRNO_CODES[e.code]);
2314 return fs.readdirSync(path);
2317 throw new FS.ErrnoError(ERRNO_CODES[e.code]);
2322 fs.symlinkSync(oldPath, newPath);
2325 throw new FS.ErrnoError(ERRNO_CODES[e.code]);
2330 return fs.readlinkSync(path);
2333 throw new FS.ErrnoError(ERRNO_CODES[e.code]);
2338 if (FS.isFile(stream.node.mode)) {
2339 stream.nfd = fs.openSync(path, NODEFS.flagsToPermissionString(stream.flags));
2343 throw new FS.ErrnoError(ERRNO_CODES[e.code]);
2347 if (FS.isFile(stream.node.mode) && stream.nfd) {
2348 fs.closeSync(stream.nfd);
2352 throw new FS.ErrnoError(ERRNO_CODES[e.code]);
2359 res = fs.readSync(stream.nfd, nbuffer, 0, length, position);
2361 throw new FS.ErrnoError(ERRNO_CODES[e.code]);
2374 res = fs.writeSync(stream.nfd, nbuffer, 0, length, position);
2376 throw new FS.ErrnoError(ERRNO_CODES[e.code]);
2384 if (FS.isFile(stream.node.mode)) {
2386 var stat = fs.fstatSync(stream.nfd);
2389 throw new FS.ErrnoError(ERRNO_CODES[e.code]);
2395 throw new FS.ErrnoError(ERRNO_CODES.EINVAL);
2412 }var FS={root:null,mounts:[],devices:[null],streams:[],nextInode:1,nameTable:null,currentPath:"/",initialized:false,ignorePermissions:true,ErrnoError:null,genericErrors:{},handleFSError:function (e) {
2413 if (!(e instanceof FS.ErrnoError)) throw e + ' : ' + stackTrace();
2416 path = PATH.resolve(FS.cwd(), path);
2430 throw new FS.ErrnoError(ERRNO_CODES.ELOOP);
2439 var current = FS.root;
2449 current = FS.lookupNode(current, parts[i]);
2453 if (FS.isMountpoint(current)) {
2463 while (FS.isLink(current.mode)) {
2464 var link = FS.readlink(current_path);
2467 var lookup = FS.lookupPath(current_path, { recurse_count: opts.recurse_count });
2471 throw new FS.ErrnoError(ERRNO_CODES.ELOOP);
2481 if (FS.isRoot(node)) {
2496 return ((parentid + hash) >>> 0) % FS.nameTable.length;
2498 var hash = FS.hashName(node.parent.id, node.name);
2499 node.name_next = FS.nameTable[hash];
2500 FS.nameTable[hash] = node;
2502 var hash = FS.hashName(node.parent.id, node.name);
2503 if (FS.nameTable[hash] === node) {
2504 FS.nameTable[hash] = node.name_next;
2506 var current = FS.nameTable[hash];
2516 var err = FS.mayLookup(parent);
2518 throw new FS.ErrnoError(err);
2520 var hash = FS.hashName(parent.id, name);
2521 for (var node = FS.nameTable[hash]; node; node = node.name_next) {
2528 return FS.lookup(parent, name);
2530 if (!FS.FSNode) {
2531 FS.FSNode = function(parent, name, mode, rdev) {
2538 this.id = FS.nextInode++;
2546 FS.FSNode.prototype = {};
2554 Object.defineProperties(FS.FSNode.prototype, {
2564 get: function() { return FS.isDir(this.mode); },
2567 get: function() { return FS.isChrdev(this.mode); },
2572 var node = new FS.FSNode(parent, name, mode, rdev);
2574 FS.hashAddNode(node);
2578 FS.hashRemoveNode(node);
2598 var flags = FS.flagModes[str];
2611 if (FS.ignorePermissions) {
2624 return FS.nodePermissions(dir, 'x');
2627 FS.lookupNode(dir, name);
2631 return FS.nodePermissions(dir, 'wx');
2635 node = FS.lookupNode(dir, name);
2639 var err = FS.nodePermissions(dir, 'wx');
2644 if (!FS.isDir(node.mode)) {
2647 if (FS.isRoot(node) || FS.getPath(node) === FS.cwd()) {
2651 if (FS.isDir(node.mode)) {
2660 if (FS.isLink(node.mode)) {
2662 } else if (FS.isDir(node.mode)) {
2668 return FS.nodePermissions(node, FS.flagsToPermissionString(flags));
2671 fd_end = fd_end || FS.MAX_OPEN_FDS;
2673 if (!FS.streams[fd]) {
2677 throw new FS.ErrnoError(ERRNO_CODES.EMFILE);
2679 return FS.streams[fd];
2681 if (!FS.FSStream) {
2682 FS.FSStream = function(){};
2683 FS.FSStream.prototype = {};
2685 Object.defineProperties(FS.FSStream.prototype, {
2703 stream.__proto__ = FS.FSStream.prototype;
2705 var newStream = new FS.FSStream();
2711 var fd = FS.nextfd(fd_start, fd_end);
2713 FS.streams[fd] = stream;
2716 FS.streams[fd] = null;
2718 return FS.streams[ptr - 1];
2722 var device = FS.getDevice(stream.node.rdev);
2730 throw new FS.ErrnoError(ERRNO_CODES.ESPIPE);
2738 FS.devices[dev] = { stream_ops: ops };
2740 return FS.devices[dev];
2760 var mounts = FS.getMounts(FS.root.mount);
2788 if (root && FS.root) {
2789 throw new FS.ErrnoError(ERRNO_CODES.EBUSY);
2791 var lookup = FS.lookupPath(mountpoint, { follow_mount: false });
2796 if (FS.isMountpoint(node)) {
2797 throw new FS.ErrnoError(ERRNO_CODES.EBUSY);
2800 if (!FS.isDir(node.mode)) {
2801 throw new FS.ErrnoError(ERRNO_CODES.ENOTDIR);
2812 // create a root node for the fs
2818 FS.root = mountRoot;
2831 var lookup = FS.lookupPath(mountpoint, { follow_mount: false });
2833 if (!FS.isMountpoint(lookup.node)) {
2834 throw new FS.ErrnoError(ERRNO_CODES.EINVAL);
2840 var mounts = FS.getMounts(mount);
2842 Object.keys(FS.nameTable).forEach(function (hash) {
2843 var current = FS.nameTable[hash];
2849 FS.destroyNode(current);
2866 var lookup = FS.lookupPath(path, { parent: true });
2869 var err = FS.mayCreate(parent, name);
2871 throw new FS.ErrnoError(err);
2874 throw new FS.ErrnoError(ERRNO_CODES.EPERM);
2881 return FS.mknod(path, mode, 0);
2886 return FS.mknod(path, mode, 0);
2893 return FS.mknod(path, mode, dev);
2895 var lookup = FS.lookupPath(newpath, { parent: true });
2898 var err = FS.mayCreate(parent, newname);
2900 throw new FS.ErrnoError(err);
2903 throw new FS.ErrnoError(ERRNO_CODES.EPERM);
2914 lookup = FS.lookupPath(old_path, { parent: true });
2916 lookup = FS.lookupPath(new_path, { parent: true });
2919 throw new FS.ErrnoError(ERRNO_CODES.EBUSY);
2923 throw new FS.ErrnoError(ERRNO_CODES.EXDEV);
2926 var old_node = FS.lookupNode(old_dir, old_name);
2930 throw new FS.ErrnoError(ERRNO_CODES.EINVAL);
2935 throw new FS.ErrnoError(ERRNO_CODES.ENOTEMPTY);
2940 new_node = FS.lookupNode(new_dir, new_name);
2949 var isdir = FS.isDir(old_node.mode);
2950 var err = FS.mayDelete(old_dir, old_name, isdir);
2952 throw new FS.ErrnoError(err);
2957 FS.mayDelete(new_dir, new_name, isdir) :
2958 FS.mayCreate(new_dir, new_name);
2960 throw new FS.ErrnoError(err);
2963 throw new FS.ErrnoError(ERRNO_CODES.EPERM);
2965 if (FS.isMountpoint(old_node) || (new_node && FS.isMountpoint(new_node))) {
2966 throw new FS.ErrnoError(ERRNO_CODES.EBUSY);
2970 err = FS.nodePermissions(old_dir, 'w');
2972 throw new FS.ErrnoError(err);
2976 FS.hashRemoveNode(old_node);
2977 // do the underlying fs rename
2985 FS.hashAddNode(old_node);
2988 var lookup = FS.lookupPath(path, { parent: true });
2991 var node = FS.lookupNode(parent, name);
2992 var err = FS.mayDelete(parent, name, true);
2994 throw new FS.ErrnoError(err);
2997 throw new FS.ErrnoError(ERRNO_CODES.EPERM);
2999 if (FS.isMountpoint(node)) {
3000 throw new FS.ErrnoError(ERRNO_CODES.EBUSY);
3003 FS.destroyNode(node);
3005 var lookup = FS.lookupPath(path, { follow: true });
3008 throw new FS.ErrnoError(ERRNO_CODES.ENOTDIR);
3012 var lookup = FS.lookupPath(path, { parent: true });
3015 var node = FS.lookupNode(parent, name);
3016 var err = FS.mayDelete(parent, name, false);
3020 throw new FS.ErrnoError(err);
3023 throw new FS.ErrnoError(ERRNO_CODES.EPERM);
3025 if (FS.isMountpoint(node)) {
3026 throw new FS.ErrnoError(ERRNO_CODES.EBUSY);
3029 FS.destroyNode(node);
3031 var lookup = FS.lookupPath(path);
3034 throw new FS.ErrnoError(ERRNO_CODES.EINVAL);
3038 var lookup = FS.lookupPath(path, { follow: !dontFollow });
3041 throw new FS.ErrnoError(ERRNO_CODES.EPERM);
3045 return FS.stat(path, true);
3049 var lookup = FS.lookupPath(path, { follow: !dontFollow });
3055 throw new FS.ErrnoError(ERRNO_CODES.EPERM);
3062 FS.chmod(path, mode, true);
3064 var stream = FS.getStream(fd);
3066 throw new FS.ErrnoError(ERRNO_CODES.EBADF);
3068 FS.chmod(stream.node, mode);
3072 var lookup = FS.lookupPath(path, { follow: !dontFollow });
3078 throw new FS.ErrnoError(ERRNO_CODES.EPERM);
3085 FS.chown(path, uid, gid, true);
3087 var stream = FS.getStream(fd);
3089 throw new FS.ErrnoError(ERRNO_CODES.EBADF);
3091 FS.chown(stream.node, uid, gid);
3094 throw new FS.ErrnoError(ERRNO_CODES.EINVAL);
3098 var lookup = FS.lookupPath(path, { follow: true });
3104 throw new FS.ErrnoError(ERRNO_CODES.EPERM);
3106 if (FS.isDir(node.mode)) {
3107 throw new FS.ErrnoError(ERRNO_CODES.EISDIR);
3109 if (!FS.isFile(node.mode)) {
3110 throw new FS.ErrnoError(ERRNO_CODES.EINVAL);
3112 var err = FS.nodePermissions(node, 'w');
3114 throw new FS.ErrnoError(err);
3121 var stream = FS.getStream(fd);
3123 throw new FS.ErrnoError(ERRNO_CODES.EBADF);
3126 throw new FS.ErrnoError(ERRNO_CODES.EINVAL);
3128 FS.truncate(stream.node, len);
3130 var lookup = FS.lookupPath(path, { follow: true });
3136 flags = typeof flags === 'string' ? FS.modeStringToFlags(flags) : flags;
3149 var lookup = FS.lookupPath(path, {
3162 throw new FS.ErrnoError(ERRNO_CODES.EEXIST);
3166 node = FS.mknod(path, mode, 0);
3170 throw new FS.ErrnoError(ERRNO_CODES.ENOENT);
3173 if (FS.isChrdev(node.mode)) {
3177 var err = FS.mayOpen(node, flags);
3179 throw new FS.ErrnoError(err);
3183 FS.truncate(node, 0);
3189 var stream = FS.createStream({
3191 path: FS.getPath(node), // we want the absolute path to the node
3205 if (!FS.readFiles) FS.readFiles = {};
3206 if (!(path in FS.readFiles)) {
3207 FS.readFiles[path] = 1;
3220 FS.closeStream(stream.fd);
3224 throw new FS.ErrnoError(ERRNO_CODES.ESPIPE);
3229 throw new FS.ErrnoError(ERRNO_CODES.EINVAL);
3232 throw new FS.ErrnoError(ERRNO_CODES.EBADF);
3234 if (FS.isDir(stream.node.mode)) {
3235 throw new FS.ErrnoError(ERRNO_CODES.EISDIR);
3238 throw new FS.ErrnoError(ERRNO_CODES.EINVAL);
3245 throw new FS.ErrnoError(ERRNO_CODES.ESPIPE);
3252 throw new FS.ErrnoError(ERRNO_CODES.EINVAL);
3255 throw new FS.ErrnoError(ERRNO_CODES.EBADF);
3257 if (FS.isDir(stream.node.mode)) {
3258 throw new FS.ErrnoError(ERRNO_CODES.EISDIR);
3261 throw new FS.ErrnoError(ERRNO_CODES.EINVAL);
3268 throw new FS.ErrnoError(ERRNO_CODES.ESPIPE);
3272 FS.llseek(stream, 0, 2);
3279 throw new FS.ErrnoError(ERRNO_CODES.EINVAL);
3282 throw new FS.ErrnoError(ERRNO_CODES.EBADF);
3284 if (!FS.isFile(stream.node.mode) && !FS.isDir(node.mode)) {
3285 throw new FS.ErrnoError(ERRNO_CODES.ENODEV);
3288 throw new FS.ErrnoError(ERRNO_CODES.EOPNOTSUPP);
3294 throw new FS.ErrnoError(ERRNO_CODES.EACCES);
3297 throw new FS.ErrnoError(ERRNO_CODES.ENODEV);
3302 throw new FS.ErrnoError(ERRNO_CODES.ENOTTY);
3313 var stream = FS.open(path, opts.flags);
3314 var stat = FS.stat(path);
3317 FS.read(stream, buf, 0, length, 0);
3327 FS.close(stream);
3336 var stream = FS.open(path, opts.flags, opts.mode);
3340 FS.write(stream, buf, 0, buf.length, 0, opts.canOwn);
3342 FS.write(stream, data, 0, data.length, 0, opts.canOwn);
3344 FS.close(stream);
3346 return FS.currentPath;
3348 var lookup = FS.lookupPath(path, { follow: true });
3349 if (!FS.isDir(lookup.node.mode)) {
3350 throw new FS.ErrnoError(ERRNO_CODES.ENOTDIR);
3352 var err = FS.nodePermissions(lookup.node, 'x');
3354 throw new FS.ErrnoError(err);
3356 FS.currentPath = lookup.path;
3358 FS.mkdir('/tmp');
3361 FS.mkdir('/dev');
3363 FS.registerDevice(FS.makedev(1, 3), {
3367 FS.mkdev('/dev/null', FS.makedev(1, 3));
3371 TTY.register(FS.makedev(5, 0), TTY.default_tty_ops);
3372 TTY.register(FS.makedev(6, 0), TTY.default_tty1_ops);
3373 FS.mkdev('/dev/tty', FS.makedev(5, 0));
3374 FS.mkdev('/dev/tty1', FS.makedev(6, 0));
3377 FS.mkdir('/dev/shm');
3378 FS.mkdir('/dev/shm/tmp');
3381 // input / output callback and that utilizes FS.createDevice
3389 FS.createDevice('/dev', 'stdin', Module['stdin']);
3391 FS.symlink('/dev/tty', '/dev/stdin');
3394 FS.createDevice('/dev', 'stdout', null, Module['stdout']);
3396 FS.symlink('/dev/tty', '/dev/stdout');
3399 FS.createDevice('/dev', 'stderr', null, Module['stderr']);
3401 FS.symlink('/dev/tty1', '/dev/stderr');
3405 var stdin = FS.open('/dev/stdin', 'r');
3406 HEAP32[((_stdin)>>2)]=FS.getPtrForStream(stdin);
3409 var stdout = FS.open('/dev/stdout', 'w');
3410 HEAP32[((_stdout)>>2)]=FS.getPtrForStream(stdout);
3413 var stderr = FS.open('/dev/stderr', 'w');
3414 HEAP32[((_stderr)>>2)]=FS.getPtrForStream(stderr);
3417 if (FS.ErrnoError) return;
3418 FS.ErrnoError = function ErrnoError(errno) {
3428 FS.ErrnoError.prototype = new Error();
3429 FS.ErrnoError.prototype.constructor = FS.ErrnoError;
3432 FS.genericErrors[code] = new FS.ErrnoError(code);
3433 FS.genericErrors[code].stack = '<generic error, no stack>';
3436 FS.ensureErrnoError();
3438 FS.nameTable = new Array(4096);
3440 FS.mount(MEMFS, {}, '/');
3442 FS.createDefaultDirectories();
3443 FS.createDefaultDevices();
3445 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)');
3446 FS.init.initialized = true;
3448 FS.ensureErrnoError();
3455 FS.createStandardStreams();
3457 FS.init.initialized = false;
3458 for (var i = 0; i < FS.streams.length; i++) {
3459 var stream = FS.streams[i];
3463 FS.close(stream);
3479 var ret = FS.analyzePath(path, dontResolveLastLink);
3489 var lookup = FS.lookupPath(path, { follow: !dontResolveLastLink });
3498 var lookup = FS.lookupPath(path, { parent: true });
3503 lookup = FS.lookupPath(path, { follow: !dontResolveLastLink });
3514 var path = PATH.join2(typeof parent === 'string' ? parent : FS.getPath(parent), name);
3515 var mode = FS.getMode(canRead, canWrite);
3516 return FS.mkdir(path, mode);
3518 parent = typeof parent === 'string' ? parent : FS.getPath(parent);
3525 FS.mkdir(current);
3533 var path = PATH.join2(typeof parent === 'string' ? parent : FS.getPath(parent), name);
3534 var mode = FS.getMode(canRead, canWrite);
3535 return FS.create(path, mode);
3537 var path = name ? PATH.join2(typeof parent === 'string' ? parent : FS.getPath(parent), name) : parent;
3538 var mode = FS.getMode(canRead, canWrite);
3539 var node = FS
3547 FS.chmod(node, mode | 146);
3548 var stream = FS.open(node, 'w');
3549 FS.write(stream, data, 0, data.length, 0, canOwn);
3550 FS.close(stream);
3551 FS.chmod(node, mode);
3555 var path = PATH.join2(typeof parent === 'string' ? parent : FS.getPath(parent), name);
3556 var mode = FS.getMode(!!input, !!output);
3557 if (!FS.createDevice.major) FS.createDevice.major = 64;
3558 var dev = FS.makedev(FS.createDevice.major++, 0);
3561 FS.registerDevice(dev, {
3578 throw new FS.ErrnoError(ERRNO_CODES.EIO);
3581 throw new FS.ErrnoError(ERRNO_CODES.EAGAIN);
3597 throw new FS.ErrnoError(ERRNO_CODES.EIO);
3606 return FS.mkdev(path, mode, dev);
3608 var path = PATH.join2(typeof parent === 'string' ? parent : FS.getPath(parent), name);
3609 return FS.symlink(target, path);
3724 var node = FS.createFile(parent, name, properties, canRead, canWrite);
3740 if (!FS.forceLoadFile(node)) {
3741 throw new FS.ErrnoError(ERRNO_CODES.EIO);
3748 if (!FS.forceLoadFile(node)) {
3749 throw new FS.ErrnoError(ERRNO_CODES.EIO);
3777 FS.createDataFile(parent, name, byteArray, canRead, canWrite, canOwn);
3810 var indexedDB = FS.indexedDB();
3812 var openRequest = indexedDB.open(FS.DB_NAME(), FS.DB_VERSION);
3819 db.createObjectStore(FS.DB_STORE_NAME);
3823 var transaction = db.transaction([FS.DB_STORE_NAME], 'readwrite');
3824 var files = transaction.objectStore(FS.DB_STORE_NAME);
3830 var putRequest = files.put(FS.analyzePath(path).object.contents, path);
3840 var indexedDB = FS.indexedDB();
3842 var openRequest = indexedDB.open(FS.DB_NAME(), FS.DB_VERSION);
3850 var transaction = db.transaction([FS.DB_STORE_NAME], 'readonly');
3855 var files = transaction.objectStore(FS.DB_STORE_NAME);
3863 if (FS.analyzePath(path).exists) {
3864 FS.unlink(path);
3866 FS.createDataFile(PATH.dirname(path), PATH.basename(path), getRequest.result, true, true, true);
3881 return FS.createNode(null, '/', 16384 | 511 /* 0777 */, 0);
3902 var node = FS.createNode(SOCKFS.root, name, 49152, 0);
3907 var stream = FS.createStream({
3910 flags: FS.modeStringToFlags('r+'),
3921 var stream = FS.getStream(fd);
3922 if (!stream || !FS.isSocket(stream.node.mode)) {
4019 throw new FS.ErrnoError(ERRNO_CODES.EHOSTUNREACH);
4173 throw new FS.ErrnoError(ERRNO_CODES.EINVAL); // already bound
4191 if (!(e instanceof FS.ErrnoError)) throw e;
4197 throw new FS.ErrnoError(ERRNO_CODS.EOPNOTSUPP);
4209 throw new FS.ErrnoError(ERRNO_CODES.EALREADY);
4211 throw new FS.ErrnoError(ERRNO_CODES.EISCONN);
4223 throw new FS.ErrnoError(ERRNO_CODES.EINPROGRESS);
4226 throw new FS.ErrnoError(ERRNO_CODES.EOPNOTSUPP);
4229 throw new FS.ErrnoError(ERRNO_CODES.EINVAL); // already listening
4265 throw new FS.ErrnoError(ERRNO_CODES.EINVAL);
4274 throw new FS.ErrnoError(ERRNO_CODES.ENOTCONN);
4295 throw new FS.ErrnoError(ERRNO_CODES.EDESTADDRREQ);
4309 throw new FS.ErrnoError(ERRNO_CODES.ENOTCONN);
4311 throw new FS.ErrnoError(ERRNO_CODES.EAGAIN);
4344 throw new FS.ErrnoError(ERRNO_CODES.EINVAL);
4350 throw new FS.ErrnoError(ERRNO_CODES.ENOTCONN);
4360 throw new FS.ErrnoError(ERRNO_CODES.ENOTCONN);
4368 throw new FS.ErrnoError(ERRNO_CODES.EAGAIN);
4371 throw new FS.ErrnoError(ERRNO_CODES.EAGAIN);
4409 var stream = FS.getStream(fildes);
4416 return FS.write(stream, slab, buf, nbyte, offset);
4418 FS.handleFSError(e);
4424 var stream = FS.getStream(fildes);
4433 return FS.write(stream, slab, buf, nbyte);
4435 FS.handleFSError(e);
4443 stream = FS.getStreamFromPtr(stream);
4454 var streamObj = FS.getStreamFromPtr(stream);
5583 FS.staticInit();__ATINIT__.unshift({ func: function() { if (!Module["noFSInit"] && !FS.init.initialized) FS.init() } });__ATMAIN__.push({ func: function() { FSFS.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;
5586 if (ENVIRONMENT_IS_NODE) { var fs = require("fs"); NODEFS.staticInit(); }
5587 __ATINIT__.push({ func: function() { SOCKFS.root = FS.mount(SOCKFS, {}, null); } });