Possible values for fs.writefile options parameter especially what will be integer for read-only file

Viewed 97
1 Answers

You can find the file modes available here.

You can create octals yourself as per documentation.

An easier method of constructing the mode is to use a sequence of three octal digits (e.g. 765). The left-most digit (7 in the example), specifies the permissions for the file owner. The middle digit (6 in the example), specifies permissions for the group. The right-most digit (5 in the example), specifies the permissions for others.

Read only should be 0o444

enter image description here

Related