Method description:
Synchronous version of unlink() , delete file operation.
grammar:
The code copy is as follows:
fs.unlinkSync(path)
Since this method belongs to the fs module, it is necessary to introduce the fs module before use (var fs= require("fs") )
Receive parameters:
path file path
example:
The code copy is as follows:
var fs = require('fs');
var filepath = '126.txt';
fs.unlinkSync(filepath);
Source code:
The code copy is as follows:
fs.unlinkSync = function(path) {
nullCheck(path);
return binding.unlink(pathModule._makeLong(path));
};