https://nodejs.org/api/fs.html#fs_fs_createwritestream_path_options
It mentions the option mode
with the value 0o666
. As you can read if you click the link there is no real description of what this.
I am presuming it is the file permission to be set. However I'm not used to seeing 0o666
. Am I correct that it is the file permission and if so, what does 0o666
stand for?
A NODE file contains an addon, which is a compiled library of functions used by one or more Node. js applications. It stores binary data compiled from a GYP file written in the C++ programming language.
__dirname: It is a local variable that returns the directory name of the current module. It returns the folder path of the current JavaScript file. Difference between process.cwd() vs __dirname in Node.js is as follows: process.cwd()
js file system module allows you to work with the file system on your computer. To include the File System module, use the require() method: var fs = require('fs'); Common use for the File System module: Read files.
I was correct it was octal file permissions for the file. 0o
in ES6 represents octal.
http://www.2ality.com/2015/04/numbers-math-es6.html
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With