How to control file access in Windows?
Go provides os.Chmod() for setting file and directory permissions. For example, if I want to ensure a file is accessible only to the current user, I can do the following: os.Chmod("somefile.txt", 0600) This works great on Linux but does absolutely nothing on Windows. After digging into the Go source code, I came across its implementation . It seems like S_IWRITE is the only attribute supported. How do I control access to a file or directory on Windows using Go? Explanation Windows does not use traditional Unix permissions. Instead, Windows controls access to files and directories through