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 LCOW: Add environment variable to enable 2017-06-20 08:55:46 -07:00
chtimes_test.go This fixes Chtimes on systems with 32 bit Timespec 2015-11-19 11:08:29 -08:00
chtimes_unix.go Fixing 'docker save' on Windows. 2016-02-08 18:08:49 -08:00
chtimes_unix_test.go Modify func name from TestChtimes to TestChtimesLinux 2016-07-27 10:05:59 +08:00
chtimes_windows.go [project] change syscall to /x/sys/unix|windows 2017-07-11 08:00:32 -04:00
chtimes_windows_test.go Modify func name from TestChtimes to TestChtimesLinux 2016-07-27 10:05:59 +08:00
errors.go fix golint warnings/errors on pkg/system and pkg/stdcopy 2015-08-13 18:47:13 +08:00
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 LCOW: Add environment variable to enable 2017-06-20 08:55:46 -07:00
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: Graphdriver 2017-06-20 19:49:24 -07:00
lcow_windows.go LCOW: Graphdriver 2017-06-20 19:49:24 -07:00
lstat_unix.go [project] change syscall to /x/sys/unix|windows 2017-07-11 08:00:32 -04:00
lstat_unix_test.go Fixed file modified time not changing on Windows 2015-10-01 10:45:32 -07:00
lstat_windows.go Tidy pkg\system *stat* functions 2017-04-05 16:01:53 -07:00
meminfo.go Add MemInfo to the system pkg. 2014-10-22 14:05:45 -07:00
meminfo_linux.go fix typos 2016-03-11 23:22:16 +08:00
meminfo_unix_test.go Replace pkg/units with docker/go-units. 2015-12-16 12:26:49 -05:00
meminfo_unsupported.go Remove solaris build tag and `contrib/mkimage/solaris 2017-11-02 00:01:46 +00:00
meminfo_windows.go Swap usage of LazyDLL and LoadDLL to LazySystemDLL. 2016-11-22 14:57:11 -08:00
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 fix golint warnings/errors on pkg/system and pkg/stdcopy 2015-08-13 18:47:13 +08:00
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 Do not remove containers from memory on error 2017-05-05 17:02:04 -04:00
stat_darwin.go Tidy pkg\system *stat* functions 2017-04-05 16:01:53 -07:00
stat_freebsd.go Tidy pkg\system *stat* functions 2017-04-05 16:01:53 -07:00
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 Tidy pkg\system *stat* functions 2017-04-05 16:01:53 -07:00
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 fix golint warnings/errors on pkg/system and pkg/stdcopy 2015-08-13 18:47:13 +08:00
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 skip api/types/container/ (like golint) and fix one pkg 2016-11-18 16:33:50 -08:00
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 fix golint warnings/errors on pkg/system and pkg/stdcopy 2015-08-13 18:47:13 +08:00