feat(pkg): add paths CopyFS function.
This commit is contained in:
parent
ccb7ee9b15
commit
3b6b50cf63
1 changed files with 6 additions and 0 deletions
|
|
@ -388,6 +388,12 @@ func CopyTo(src *Path, dst *Path) error {
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// CopyFS copies the file system fsys into the directory dir,
|
||||||
|
// creating dir if necessary. It is the exivalent of os.CopyFS with Path.
|
||||||
|
func (p *Path) CopyFS(dst *Path) error {
|
||||||
|
return os.CopyFS(dst.String(), os.DirFS(p.String()))
|
||||||
|
}
|
||||||
|
|
||||||
// CopyDirTo recursively copies the directory denoted by the current path to
|
// CopyDirTo recursively copies the directory denoted by the current path to
|
||||||
// the destination path. The source directory must exist and the destination
|
// the destination path. The source directory must exist and the destination
|
||||||
// directory must NOT exist (no implicit destination name allowed).
|
// directory must NOT exist (no implicit destination name allowed).
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue