const ( // PrivateFileMode grants owner to read/write a file. PrivateFileMode = 0600 )
Copies file by reading the file then writing atomically into the target directory
Write atomically by writing to a temporary file in the same directory then renaming
DirEquals check if two directories are referring to the same directory
IsDirWriteable checks if dir is writable by writing and removing a file to dir. It returns nil if dir is writable. Inspired by etcd fileutil.