| 
                         方法说明: 
创建硬链接。 
语法: 
复制代码 代码如下: 
fs.link(srcpath, dstpath, [callback(err)]) 
 
由于该方法属于fs模块,使用前需要引入fs模块(var fs= require(“fs”) ) 
接收参数: 
srcpathnbsp;nbsp;nbsp;nbsp;nbsp;nbsp;nbsp; 为源目录或文件的路径 
dstpathnbsp;nbsp;nbsp;nbsp;nbsp;nbsp; 它是存放转换后的目录的路径,默认为当前工作目录 
callbacknbsp;nbsp;nbsp;nbsp;nbsp; 回调,传递一个err异常参数 
源码: 
复制代码 代码如下: 
fs.link = function(srcpath, dstpath, callback) { 
nbsp; callback = makeCallback(callback); 
nbsp; if (!nullCheck(srcpath, callback)) return; 
nbsp; if (!nullCheck(dstpath, callback)) return; 
nbsp; binding.link(pathModule._makeLong(srcpath), 
nbsp;nbsp;nbsp;nbsp;nbsp;nbsp;nbsp;nbsp;nbsp;nbsp;nbsp;nbsp;nbsp;nbsp; pathModule._makeLong(dstpath), 
nbsp;nbsp;nbsp;nbsp;nbsp;nbsp;nbsp;nbsp;nbsp;nbsp;nbsp;nbsp;nbsp;nbsp; callback); 
}; 
                         (编辑:滁州站长网) 
【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! 
                     |