Node.js 文件系统

2020-06-17 05:30:31易采站长站整理

异步 chmod().回调函数没有参数,但可能抛出异常。13fs.chmodSync(path, mode)
同步 chmod().14fs.fchmod(fd, mode, callback)
异步 fchmod().回调函数没有参数,但可能抛出异常。15fs.fchmodSync(fd, mode)
同步 fchmod().16fs.lchmod(path, mode, callback)
异步 lchmod().回调函数没有参数,但可能抛出异常。Only available on Mac OS X.17fs.lchmodSync(path, mode)
同步 lchmod().18fs.stat(path, callback)
异步 stat(). 回调函数有两个参数 err, stats,stats 是 fs.Stats 对象。19fs.lstat(path, callback)
异步 lstat(). 回调函数有两个参数 err, stats,stats 是 fs.Stats 对象。 20fs.fstat(fd, callback)
异步 fstat(). 回调函数有两个参数 err, stats,stats 是 fs.Stats 对象。 21fs.statSync(path)
同步 stat(). 返回 fs.Stats 的实例。22fs.lstatSync(path)
同步 lstat(). 返回 fs.Stats 的实例。23fs.fstatSync(fd)
同步 fstat(). 返回 fs.Stats 的实例。24fs.link(srcpath, dstpath, callback)
异步 link().回调函数没有参数,但可能抛出异常。25fs.linkSync(srcpath, dstpath)
同步 link().26fs.symlink(srcpath, dstpath[, type], callback)
异步 symlink().回调函数没有参数,但可能抛出异常。 type 参数可以设置为 ‘dir’, ‘file’, 或 ‘junction’ (默认为 ‘file’) 。27fs.symlinkSync(srcpath, dstpath[, type])
同步 symlink().28fs.readlink(path, callback)
异步 readlink(). 回调函数有两个参数 err, linkString。29fs.realpath(path[, cache], callback)
异步 realpath(). 回调函数有两个参数 err, resolvedPath。30fs.realpathSync(path[, cache])
同步 realpath()。返回绝对路径。31fs.unlink(path, callback)
异步 unlink().回调函数没有参数,但可能抛出异常。32fs.unlinkSync(path)
同步 unlink().33fs.rmdir(path, callback)
异步 rmdir().回调函数没有参数,但可能抛出异常。34fs.rmdirSync(path)
同步 rmdir().35fs.mkdir(path[, mode], callback)
S异步 mkdir(2).回调函数没有参数,但可能抛出异常。 访问权限默认为 0777。36fs.mkdirSync(path[, mode])
同步 mkdir().37