September 2017
Intermediate to advanced
466 pages
9h 33m
English
This section will explain how to change the Unix permissions of a file or a directory to the desired value; however, it will not deal with the sticky bit, the set user ID bit, or the set group ID bit: not because they are difficult to implement, but because you usually do not need any of these when dealing with system files.
The name of the utility will be setFilePerm.go, and it will be presented in four parts. The new file permissions will be given as a string with nine characters such as rwxrw-rw-.
The first part of setFilePerm.go contains the expected preamble Go code:
package main import ( "fmt" "os" "path/filepath" "strconv" )
The second part is the implementation of the tripletToBinary() function that you ...
Read now
Unlock full access