moby/pkg/idtools
Kir Kolyshkin 2aa13f86f0 idtools.MkdirAs*: error out if dir exists as file
Standard golang's `os.MkdirAll()` function returns "not a directory" error
in case a directory to be created already exists but is not a directory
(e.g. a file). Our own `idtools.MkdirAs*()` functions do not replicate
the behavior.

This is a bug since all `Mkdir()`-like functions are expected to ensure
the required directory exists and is indeed a directory, and return an
error otherwise.

As the code is using our in-house `system.Stat()` call returning a type
which is incompatible with that of golang's `os.Stat()`, I had to amend
the `system` package with `IsDir()`.

A test case is also provided.

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
2017-11-27 13:25:44 -08:00
..
idtools.go Remove deprecated MkdirAllAs(), MkdirAs() 2017-11-21 13:53:54 +01:00
idtools_unix.go idtools.MkdirAs*: error out if dir exists as file 2017-11-27 13:25:44 -08:00
idtools_unix_test.go idtools.MkdirAs*: error out if dir exists as file 2017-11-27 13:25:44 -08:00
idtools_windows.go LCOW: Create layer folders with correct ACL 2017-06-20 19:50:12 -07:00
usergroupadd_linux.go Add support for looking up user/groups via getent 2016-10-28 19:06:07 -04:00
usergroupadd_unsupported.go Correct build-time directory creation with user namespaced daemon 2015-10-20 08:59:48 -04:00
utils_unix.go Add support for looking up user/groups via getent 2016-10-28 19:06:07 -04:00