1
0
Fork 0
mirror of https://github.com/moby/moby.git synced 2022-11-09 12:21:53 -05:00
moby--moby/pkg/system
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
..
chtimes.go
chtimes_test.go
chtimes_unix.go
chtimes_unix_test.go
chtimes_windows.go [project] change syscall to /x/sys/unix|windows 2017-07-11 08:00:32 -04:00
chtimes_windows_test.go
errors.go
exitcode.go Removing unused code with a TODO that no longer needs to be done 2017-10-16 14:57:48 -07:00
filesys.go LCOW: Create layer folders with correct ACL 2017-06-20 19:50:12 -07:00
filesys_windows.go [project] change syscall to /x/sys/unix|windows 2017-07-11 08:00:32 -04:00
init.go
init_unix.go Add LCOW behind experimental, 2017-09-14 13:51:16 -07:00
init_windows.go LCOW: API: Add platform to /images/create and /build 2017-10-06 11:44:18 -07:00
lcow.go LCOW: API change JSON header to string POST parameter 2017-10-06 15:26:48 -07:00
lcow_unix.go
lcow_windows.go
lstat_unix.go [project] change syscall to /x/sys/unix|windows 2017-07-11 08:00:32 -04:00
lstat_unix_test.go
lstat_windows.go
meminfo.go
meminfo_linux.go
meminfo_unix_test.go
meminfo_unsupported.go Remove solaris build tag and `contrib/mkimage/solaris 2017-11-02 00:01:46 +00:00
meminfo_windows.go
mknod.go Use Mkdev, Major and Minor functions from golang.org/x/sys/unix 2017-10-19 08:28:38 +02:00
mknod_windows.go
path.go LCOW: API: Add platform to /images/create and /build 2017-10-06 11:44:18 -07:00
path_windows_test.go LCOW: Implemented support for docker cp + build 2017-09-14 12:07:52 -07:00
process_unix.go Remove solaris build tag and `contrib/mkimage/solaris 2017-11-02 00:01:46 +00:00
process_windows.go Update libcontainerd to use containerd 1.0 2017-10-20 07:11:37 -07:00
rm.go Update libcontainerd to use containerd 1.0 2017-10-20 07:11:37 -07:00
rm_test.go
stat_darwin.go
stat_freebsd.go
stat_linux.go Add unconvert linter 2017-08-24 15:08:31 -04:00
stat_openbsd.go Tidy pkg\system *stat* functions 2017-04-05 16:01:53 -07:00
stat_solaris.go
stat_unix.go idtools.MkdirAs*: error out if dir exists as file 2017-11-27 13:25:44 -08:00
stat_unix_test.go Add ineffassign linter 2017-09-08 18:23:21 -04:00
stat_windows.go Tidy pkg\system *stat* functions 2017-04-05 16:01:53 -07:00
syscall_unix.go [project] change syscall to /x/sys/unix|windows 2017-07-11 08:00:32 -04:00
syscall_windows.go Update logrus to v1.0.1 2017-07-31 13:16:46 -07:00
syscall_windows_test.go Add os_version and os_features to Image 2016-04-04 13:14:57 -07:00
umask.go [project] change syscall to /x/sys/unix|windows 2017-07-11 08:00:32 -04:00
umask_windows.go
utimes_freebsd.go [project] change syscall to /x/sys/unix|windows 2017-07-11 08:00:32 -04:00
utimes_linux.go [project] change syscall to /x/sys/unix|windows 2017-07-11 08:00:32 -04:00
utimes_unix_test.go
utimes_unsupported.go make more pkgs support darwin 2016-08-10 22:56:05 +08:00
xattrs_linux.go system: Use symlink xattr functions from x/sys/unix 2017-07-12 14:52:42 +02:00
xattrs_unsupported.go