package fs
import "github.com/tonistiigi/fsutil/copy"
Index ¶
- func AllowWildcards(ci *CopyInfo)
- func AllowXAttrErrors(ci *CopyInfo)
- func Chown(p string, old *User, fn Chowner) error
- func Copy(ctx context.Context, srcRoot, src, dstRoot, dst string, opts ...Opt) error
- func GetLinkInfo(fi os.FileInfo) (uint64, bool)
- func MkdirAll(path string, perm os.FileMode, user Chowner, tm *time.Time) ([]string, error)
- func ResolveWildcards(root, src string, followLinks bool) ([]string, error)
- func Utimes(p string, tm *time.Time) error
- func WithCopyInfo(ci CopyInfo) func(*CopyInfo)
- type Chowner
- type CopyInfo
- type Opt
- func WithChangeNotifier(fn fsutil.ChangeFunc) Opt
- func WithChown(uid, gid int) Opt
- func WithExcludePattern(excludePattern string) Opt
- func WithIncludePattern(includePattern string) Opt
- func WithXAttrErrorHandler(h XAttrErrorHandler) Opt
- type User
- type XAttrErrorHandler
Functions ¶
func AllowWildcards ¶
func AllowWildcards(ci *CopyInfo)
func AllowXAttrErrors ¶
func AllowXAttrErrors(ci *CopyInfo)
func Chown ¶
func Copy ¶
Copy copies files using `cp -a` semantics. Copy is likely unsafe to be used in non-containerized environments.
func GetLinkInfo ¶
GetLinkInfo returns an identifier representing the node a hardlink is pointing to. If the file is not hard linked then 0 will be returned.
func MkdirAll ¶
MkdirAll is forked os.MkdirAll
func ResolveWildcards ¶
func Utimes ¶
func WithCopyInfo ¶
Types ¶
type Chowner ¶
type CopyInfo ¶
type CopyInfo struct {
Chown Chowner
Utime *time.Time
AllowWildcards bool
Mode *int
// ModeStr is mode in non-octal format. Overrides Mode if non-empty.
ModeStr string
XAttrErrorHandler XAttrErrorHandler
CopyDirContents bool
FollowLinks bool
// Include only files/dirs matching at least one of these patterns
IncludePatterns []string
// Exclude files/dir matching any of these patterns (even if they match an include pattern)
ExcludePatterns []string
// If true, any source path that overwrite existing destination paths will always replace
// the existing destination path, even if they are of different types (e.g. a directory will
// replace any existing symlink or file)
AlwaysReplaceExistingDestPaths bool
ChangeFunc fsutil.ChangeFunc
}
type Opt ¶
type Opt func(*CopyInfo)
func WithChangeNotifier ¶
func WithChangeNotifier(fn fsutil.ChangeFunc) Opt
func WithChown ¶
func WithExcludePattern ¶
func WithIncludePattern ¶
func WithXAttrErrorHandler ¶
func WithXAttrErrorHandler(h XAttrErrorHandler) Opt
type User ¶
type XAttrErrorHandler ¶
Source Files ¶
copy.go copy_windows.go hardlink.go hardlink_windows.go mkdir.go mkdir_windows.go
- Version
- v0.0.0-20250417144416-3f76f8130144 (latest)
- Published
- Apr 17, 2025
- Platform
- windows/amd64
- Imports
- 19 packages
- Last checked
- 11 months ago –
Tools for package owners.