方法说明:
同步版的 fs.link() 。
语法:
复制代码 代码如下:
复制代码
fs.linkSync(srcpath, dstpath)
fs.linkSync(srcpath, dstpath)
由于该方法属于fs模块,使用前需要引入fs模块(var fs= require(“fs”) )
接收参数:
srcpath 为源目录或文件的路径
dstpath 它是存放转换后的目录的路径,默认为当前工作目录
源码:
复制代码 代码如下:
复制代码
fs.linkSync = function(srcpath, dstpath) {
nullCheck(srcpath);
nullCheck(dstpath);
return binding.link(pathModule._makeLong(srcpath),
pathModule._makeLong(dstpath));
};
fs.linkSync = function(srcpath, dstpath) {
nullCheck(srcpath);
nullCheck(dstpath);
return binding.link(pathModule._makeLong(srcpath),
pathModule._makeLong(dstpath));
};
最后
以上就是仁爱绿茶最近收集整理的关于node.js中的fs.linkSync方法使用说明的全部内容,更多相关node.js中内容请搜索靠谱客的其他文章。
本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
发表评论 取消回复