Using node to determine whether the opened file or folder instance


As follows:

var fs = require("fs");
//Determine whether the file or folder is opened
var path = "wen.txt";
	if (err) {
		throw err;
	Console. Info (path + "is a" + stat.isfile());
	Console. Info (path + "is a" + stat.isdirectory());
}); ("file opened successfully...);

The above example of using node to determine whether a file or a folder is opened is all the content shared by Xiaobian. I hope it can give you a reference, and I hope you can support developepaer more.

Recommended Today

Notes on tensorflow 2 deep learning (I) tensorflow Foundation

This series of notes records the process of learning tensorflow2, mainly based on Learning First of all, it needs to be clear that tensorflow is a scientific computing library for deep learning algorithm, and the internal data is stored in theTensor objectAll operations (OPS) are also based on tensor objects. data type Fundamentals in […]