there are many shortcuts under the folder after installing with cnpm. What should I do when I use nodejs to read the files in the directory?
how can I tell if it is a shortcut?
how do I get the true direction of the shortcut?
there are many shortcuts under the folder after installing with cnpm. What should I do when I use nodejs to read the files in the directory?
how can I tell if it is a shortcut?
how do I get the true direction of the shortcut?
not much cnpm, you can put a so-called "shortcut" screenshot, I guess it should be symbolic links, if you just read and write documents, you do not need to make special treatment for symbolic links, read and write directly, the file system will help you deal with where symbolic links should be linked. If you are writing a program that needs to distinguish between symbolic links and ordinary files, you should use fs.lstat
to get Stats
of the target file, and then use .isSymbolicLink ()
to determine whether it is a symbolic link. If you want to read the absolute path of a symbolic link, use fs.readlink
. For more information, please see Node.js
official documents
besides, you don't have to care about shortcuts. The operating system will handle the real point
.recently I want to write a trial hand of a project with front and rear separation. since I have been self-taught nodejs, all this time, the idea is to build a back-end server with express framework, but in this way I don t know what to do in the middle...
to develop a web page in Wechat s official account, you need to obtain Wechat s web page authorization must the callback address be port 80 does this project have to configure SSL certificates ...
...
logs are recorded before each operation to prevent data loss caused by interruptions. do the following: A log B redis count + 1 C clear log 1. If the execution of An is interrupted, check the log after startup, and you can perform operation B aga...