本文整理匯總了Golang中github.com/Symantec/Dominator/lib/filesystem.SymlinkInode類的典型用法代碼示例。如果您正苦於以下問題:Golang SymlinkInode類的具體用法?Golang SymlinkInode怎麽用?Golang SymlinkInode使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
在下文中一共展示了SymlinkInode類的7個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Golang代碼示例。
示例1: makeSymlinkInode
func makeSymlinkInode(fullPathname string, inode *filesystem.SymlinkInode) {
if err := inode.Write(fullPathname); err != nil {
logger.Println(err)
} else {
logger.Printf("Made symlink inode: %s -> %s\n",
fullPathname, inode.Symlink)
}
}
示例2: addSymlink
func (decoderData *decoderData) addSymlink(header *tar.Header,
parent *filesystem.DirectoryInode, name string) error {
var newInode filesystem.SymlinkInode
newInode.Uid = uint32(header.Uid)
newInode.Gid = uint32(header.Gid)
newInode.Symlink = header.Linkname
decoderData.addEntry(parent, header.Name, name, &newInode)
return nil
}
示例3: makeSymlinkInode
func makeSymlinkInode(fullPathname string,
inode *filesystem.SymlinkInode, logger *log.Logger) error {
if err := inode.Write(fullPathname); err != nil {
logger.Println(err)
return err
}
logger.Printf("Made symlink inode: %s -> %s\n", fullPathname, inode.Symlink)
return nil
}
示例4: getSymlinkInode
func (fileSystem *FileSystem) getSymlinkInode(stat *syscall.Stat_t) (
*filesystem.SymlinkInode, bool) {
inode := fileSystem.SymlinkInodeTable[stat.Ino]
new := false
if inode == nil {
var _inode filesystem.SymlinkInode
inode = &_inode
_inode.Uid = stat.Uid
_inode.Gid = stat.Gid
fileSystem.SymlinkInodeTable[stat.Ino] = inode
new = true
}
return inode, new
}
示例5: addSymlink
func (decoderData *decoderData) addSymlink(header *tar.Header,
parent *filesystem.Directory, name string) error {
var newInode filesystem.SymlinkInode
newInode.Uid = uint32(header.Uid)
newInode.Gid = uint32(header.Gid)
newInode.Symlink = header.Linkname
decoderData.symlinkInodeTable[header.Name] = decoderData.nextInodeNumber
decoderData.fileSystem.SymlinkInodeTable[decoderData.nextInodeNumber] =
&newInode
var newEntry filesystem.Symlink
newEntry.Name = name
newEntry.InodeNumber = decoderData.nextInodeNumber
parent.SymlinkList = append(parent.SymlinkList, &newEntry)
decoderData.nextInodeNumber++
return nil
}
示例6: scanSymlinkInode
func scanSymlinkInode(inode *filesystem.SymlinkInode, fileSystem *FileSystem,
myPathName string) error {
target, err := os.Readlink(path.Join(fileSystem.rootDirectoryName,
myPathName))
if err != nil {
return err
}
inode.Symlink = target
return nil
}
示例7: makeSymlinkInode
func makeSymlinkInode(stat *syscall.Stat_t) *filesystem.SymlinkInode {
var inode filesystem.SymlinkInode
inode.Uid = stat.Uid
inode.Gid = stat.Gid
return &inode
}