本文整理汇总了Golang中github.com/Symantec/Dominator/lib/filesystem.Directory.Name方法的典型用法代码示例。如果您正苦于以下问题:Golang Directory.Name方法的具体用法?Golang Directory.Name怎么用?Golang Directory.Name使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类github.com/Symantec/Dominator/lib/filesystem.Directory
的用法示例。
在下文中一共展示了Directory.Name方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Golang代码示例。
示例1: addDirectory
func (decoderData *decoderData) addDirectory(header *tar.Header,
parent *filesystem.Directory, name string) error {
var newEntry filesystem.Directory
newEntry.Name = name
newEntry.Mode = filesystem.FileMode((header.Mode & ^syscall.S_IFMT) |
syscall.S_IFDIR)
newEntry.Uid = uint32(header.Uid)
newEntry.Gid = uint32(header.Gid)
parent.DirectoryList = append(parent.DirectoryList, &newEntry)
decoderData.directoryTable[header.Name] = &newEntry
return nil
}
示例2: addDirectory
func addDirectory(directory *filesystem.Directory,
fileSystem, oldFS *FileSystem,
name string, directoryPathName string, stat *syscall.Stat_t) error {
myPathName := path.Join(directoryPathName, name)
if fileSystem.directoryInodeList[stat.Ino] {
return errors.New("Hardlinked directory: " + myPathName)
}
fileSystem.directoryInodeList[stat.Ino] = true
var dir filesystem.Directory
dir.Name = name
dir.Mode = filesystem.FileMode(stat.Mode)
dir.Uid = stat.Uid
dir.Gid = stat.Gid
err := scanDirectory(&dir, fileSystem, oldFS, directoryPathName)
if err != nil {
return err
}
directory.DirectoryList = append(directory.DirectoryList, &dir)
return nil
}