欧美bbbwbbbw肥妇,免费乱码人妻系列日韩,一级黄片

node.js中的fs.symlink方法使用說(shuō)明

 更新時(shí)間:2014年12月15日 10:55:49   投稿:junjie  
這篇文章主要介紹了node.js中的fs.symlink方法使用說(shuō)明,本文介紹了fs.symlink的方法說(shuō)明、語(yǔ)法、接收參數(shù)、使用實(shí)例和實(shí)現(xiàn)源碼,需要的朋友可以參考下

方法說(shuō)明:

創(chuàng)建符號(hào)鏈接。

語(yǔ)法:

復(fù)制代碼 代碼如下:

fs.symlink(srcpath, dstpath, [type], [callback(err)])

由于該方法屬于fs模塊,使用前需要引入fs模塊(var fs= require(“fs”) )

接收參數(shù):

srcpath                 為源目錄或文件的路徑

dstpath                它是存放轉(zhuǎn)換后的目錄的路徑,默認(rèn)為當(dāng)前工作目錄

type                      默認(rèn)值:'file' , 可選值 ‘dir', ‘file', 或者 ‘junction' ,該項(xiàng)僅用于Windows(在其他平臺(tái)上忽略)。

注意Windows結(jié)點(diǎn)需要轉(zhuǎn)換后的目錄是絕對(duì)路徑,使用“junction”時(shí),目標(biāo)參數(shù)將自動(dòng)被歸一化到的絕對(duì)路徑。

callback               回調(diào),傳遞一個(gè)異常參數(shù)err

源碼:

復(fù)制代碼 代碼如下:

fs.symlink = function(destination, path, type_, callback) {
  var type = (util.isString(type_) ? type_ : null);
  var callback = makeCallback(arguments[arguments.length - 1]);
  if (!nullCheck(destination, callback)) return;
  if (!nullCheck(path, callback)) return;
  binding.symlink(preprocessSymlinkDestination(destination, type),
                  pathModule._makeLong(path),
                  type,
                  callback);
};

相關(guān)文章

最新評(píng)論