当前位置: 首页>>代码示例>>Golang>>正文


Golang DirectoryInode.Uid方法代码示例

本文整理汇总了Golang中github.com/Symantec/Dominator/lib/filesystem.DirectoryInode.Uid方法的典型用法代码示例。如果您正苦于以下问题:Golang DirectoryInode.Uid方法的具体用法?Golang DirectoryInode.Uid怎么用?Golang DirectoryInode.Uid使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在github.com/Symantec/Dominator/lib/filesystem.DirectoryInode的用法示例。


在下文中一共展示了DirectoryInode.Uid方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Golang代码示例。

示例1: addDirectory

func addDirectory(dirent, oldDirent *filesystem.DirectoryEntry,
	fileSystem, oldFS *FileSystem,
	directoryPathName string, stat *syscall.Stat_t) error {
	myPathName := path.Join(directoryPathName, dirent.Name)
	if stat.Ino == fileSystem.inodeNumber {
		return errors.New("Recursive directory: " + myPathName)
	}
	if _, ok := fileSystem.InodeTable[stat.Ino]; ok {
		return errors.New("Hardlinked directory: " + myPathName)
	}
	inode := new(filesystem.DirectoryInode)
	dirent.SetInode(inode)
	fileSystem.InodeTable[stat.Ino] = inode
	inode.Mode = filesystem.FileMode(stat.Mode)
	inode.Uid = stat.Uid
	inode.Gid = stat.Gid
	var oldInode *filesystem.DirectoryInode
	if oldDirent != nil {
		if oi, ok := oldDirent.Inode().(*filesystem.DirectoryInode); ok {
			oldInode = oi
		}
	}
	err, copied := scanDirectory(inode, oldInode, fileSystem, oldFS, myPathName)
	if err != nil {
		return err
	}
	if copied && filesystem.CompareDirectoriesMetadata(inode, oldInode, nil) {
		dirent.SetInode(oldInode)
		fileSystem.InodeTable[stat.Ino] = oldInode
	}
	fileSystem.DirectoryCount++
	return nil
}
开发者ID:datatonic,项目名称:Dominator,代码行数:33,代码来源:walk.go

示例2: makeDirectory

func makeDirectory(request *subproto.UpdateRequest,
	requiredInode *filesystem.DirectoryInode, pathName string, create bool) {
	var newInode subproto.Inode
	newInode.Name = pathName
	var newDirectoryInode filesystem.DirectoryInode
	newDirectoryInode.Mode = requiredInode.Mode
	newDirectoryInode.Uid = requiredInode.Uid
	newDirectoryInode.Gid = requiredInode.Gid
	newInode.GenericInode = &newDirectoryInode
	if create {
		request.DirectoriesToMake = append(request.DirectoriesToMake, newInode)
	} else {
		request.InodesToChange = append(request.InodesToChange, newInode)
	}
}
开发者ID:keep94,项目名称:Dominator,代码行数:15,代码来源:buildUpdateRequest.go

示例3: addDirectory

func (decoderData *decoderData) addDirectory(header *tar.Header,
	parent *filesystem.DirectoryInode, name string) error {
	var newInode filesystem.DirectoryInode
	newInode.Mode = filesystem.FileMode((header.Mode & ^syscall.S_IFMT) |
		syscall.S_IFDIR)
	newInode.Uid = uint32(header.Uid)
	newInode.Gid = uint32(header.Gid)
	if header.Name == "/" {
		*decoderData.directoryTable[header.Name] = newInode
		return nil
	}
	decoderData.addEntry(parent, header.Name, name, &newInode)
	decoderData.directoryTable[header.Name] = &newInode
	return nil
}
开发者ID:keep94,项目名称:Dominator,代码行数:15,代码来源:decode.go


注:本文中的github.com/Symantec/Dominator/lib/filesystem.DirectoryInode.Uid方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。