Debian Codegraph @

copy/hardlink.go

raw symbols SCIP
1 package fsscip-go gomod github.com/tonistiigi/fsutil . `github.com/tonistiigi/fsutil/copy`/
2
3 import "osscip-go gomod github.com/golang/go/src go1.21 os/"
4
5 // GetLinkInfo returns an identifier representing the node a hardlink is pointing
6 // to. If the file is not hard linked then 0 will be returned.
7 func GetLinkInfoscip-go gomod github.com/tonistiigi/fsutil . `github.com/tonistiigi/fsutil/copy`/GetLinkInfo().(fi osscip-go gomod github.com/golang/go/src go1.21 os/.FileInfoscip-go gomod github.com/golang/go/src go1.21 os/FileInfo#) (uint64, bool) {
8 return getLinkInfoscip-go gomod github.com/tonistiigi/fsutil . `github.com/tonistiigi/fsutil/copy`/getLinkInfo().(fi)
9 }
10
11 // getLinkSource returns a path for the given name and
12 // file info to its link source in the provided inode
13 // map. If the given file name is not in the map and
14 // has other links, it is added to the inode map
15 // to be a source for other link locations.
16 func getLinkSourcescip-go gomod github.com/tonistiigi/fsutil . `github.com/tonistiigi/fsutil/copy`/getLinkSource().(name string, fi osscip-go gomod github.com/golang/go/src go1.21 os/.FileInfoscip-go gomod github.com/golang/go/src go1.21 os/FileInfo#, inodes map[uint64]string) (string, error) {
17 inode, isHardlink := getLinkInfoscip-go gomod github.com/tonistiigi/fsutil . `github.com/tonistiigi/fsutil/copy`/getLinkInfo().(fi)
18 if !isHardlink {
19 return "", nil
20 }
21
22 path, ok := inodes[inode]
23 if !ok {
24 inodes[inode] = name
25 }
26 return path, nil
27 }