Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

mode: 0o666 in file system methods, what is it?

Tags:

node.js

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?

like image 391
basickarl Avatar asked Aug 19 '16 00:08

basickarl


People also ask

What is .node file?

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.

What is __ Dirname in node?

__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()

What is var fs require (' fs ')?

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.


1 Answers

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

like image 91
basickarl Avatar answered Oct 22 '22 01:10

basickarl