1package fs 2 3import "os" 4 5const ( 6 defaultRootDirMode = os.ModeDir | 0777 7 defaultSymlinkMode = os.ModeSymlink | 0666 8) 9 10func newResourceFromInfo(info os.FileInfo) resource { 11 return resource{mode: info.Mode()} 12} 13 14func (p *filePath) SetMode(mode os.FileMode) { 15 bits := mode & 0600 16 p.file.mode = bits + bits/010 + bits/0100 17} 18 19// TODO: is mode ignored on windows? 20func (p *directoryPath) SetMode(mode os.FileMode) { 21 p.directory.mode = defaultRootDirMode 22} 23