February 2018
Intermediate to advanced
340 pages
9h 43m
English
The Chmod method of the File type in the os package can be used to change file permissions. The preceding example just creates the file and changes the permissions to 0777.
Just note that the fi.Mode() is called twice because it extracts the permissions (os.FileMode) for the current state of the file.
The shortest way to change the permissions is by using the os.Chmod function, which does the same, but you do not need to obtain the File type in the code.
Read now
Unlock full access