MCPcopy
hub / github.com/moby/moby / ContainerStatPath

Method ContainerStatPath

daemon/archive.go:14–32  ·  view source on GitHub ↗

ContainerStatPath stats the filesystem resource at the specified path in the container identified by the given name.

(name string, path string)

Source from the content-addressed store, hash-verified

12// ContainerStatPath stats the filesystem resource at the specified path in the
13// container identified by the given name.
14func (daemon *Daemon) ContainerStatPath(name string, path string) (*container.PathStat, error) {
15 ctr, err := daemon.GetContainer(name)
16 if err != nil {
17 return nil, err
18 }
19
20 stat, err := daemon.containerStatPath(ctr, path)
21 if err != nil {
22 if os.IsNotExist(err) {
23 return nil, containerFileNotFound{path, name}
24 }
25 // TODO(thaJeztah): check if daemon.containerStatPath returns any errors that are not typed; if not, then return as-is
26 if cerrdefs.IsInvalidArgument(err) {
27 return nil, err
28 }
29 return nil, errdefs.System(err)
30 }
31 return stat, nil
32}
33
34// ContainerArchivePath creates an archive of the filesystem resource at the
35// specified path in the container identified by the given name. Returns a

Callers

nothing calls this directly

Calls 3

GetContainerMethod · 0.95
containerStatPathMethod · 0.95
SystemFunction · 0.92

Tested by

no test coverage detected