Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
M
mariadb
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
mariadb
Commits
0226941c
Commit
0226941c
authored
Jan 24, 2009
by
Magnus Svensson
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
mtr.pl v2
- Add debug prints for analyzing mkdir "Permission denied" failure
parent
a7e67cba
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
41 additions
and
0 deletions
+41
-0
mysql-test/lib/My/File/Path.pm
mysql-test/lib/My/File/Path.pm
+41
-0
No files found.
mysql-test/lib/My/File/Path.pm
View file @
0226941c
...
@@ -59,6 +59,42 @@ sub rmtree {
...
@@ -59,6 +59,42 @@ sub rmtree {
};
};
use
File::
Basename
;
sub
_mkpath_dbug
{
my
(
$message
,
$path
,
$dir
,
$err
)
=
@_
;
print
"
=
"
x
40
,
"
\n
";
print
$message
,
"
\n
";
print
"
err: '
$err
'
\n
";
print
"
path: '
$path
'
\n
";
print
"
dir: '
$dir
'
\n
";
print
"
-
"
x
40
,
"
\n
";
my
$dirname
=
dirname
(
$path
);
print
"
dirname:
$dirname
\n
";
print
`
ls -l
$dirname
`,
"
\n
";
print
"
-
"
x
40
,
"
\n
";
my
$dirname2
=
dirname
(
$dirname
);
print
"
dirname2:
$dirname2
\n
";
print
`
ls -l
$dirname2
`,
"
\n
";
print
"
-
"
x
40
,
"
\n
";
print
"
file exists
\n
"
if
(
-
e
$path
);
print
"
file is a plain file
\n
"
if
(
-
f
$path
);
print
"
file is a directory
\n
"
if
(
-
d
$path
);
print
"
-
"
x
40
,
"
\n
";
if
(
IS_CYGWIN
)
{
my
$posix_path
=
Cygwin::
win_to_posix_path
(
$path
);
print
"
trying to create using posix path: '
$posix_path
'
\n
";
mkdir
(
$posix_path
)
or
print
"
mkdir(posixpath) returned erro: $!
\n
";
}
print
"
=
"
x
40
,
"
\n
";
}
sub
mkpath
{
sub
mkpath
{
my
$path
;
my
$path
;
...
@@ -78,15 +114,20 @@ sub mkpath {
...
@@ -78,15 +114,20 @@ sub mkpath {
next
if
-
d
$path
;
# Path already exists and is a directory
next
if
-
d
$path
;
# Path already exists and is a directory
croak
("
File already exists but is not a directory: '
$path
'
")
if
-
e
$path
;
croak
("
File already exists but is not a directory: '
$path
'
")
if
-
e
$path
;
next
if
mkdir
(
$path
);
next
if
mkdir
(
$path
);
_mkpath_debug
("
mkdir failed
",
$path
,
$dir
,
$!
);
# mkdir failed, try one more time
# mkdir failed, try one more time
next
if
mkdir
(
$path
);
next
if
mkdir
(
$path
);
_mkpath_debug
("
mkdir failed, second time
",
$path
,
$dir
,
$!
);
# mkdir failed again, try two more time after sleep(s)
# mkdir failed again, try two more time after sleep(s)
sleep
(
1
);
sleep
(
1
);
next
if
mkdir
(
$path
);
next
if
mkdir
(
$path
);
_mkpath_debug
("
mkdir failed, third time
",
$path
,
$dir
,
$!
);
sleep
(
1
);
sleep
(
1
);
next
if
mkdir
(
$path
);
next
if
mkdir
(
$path
);
_mkpath_debug
("
mkdir failed, fourth time
",
$path
,
$dir
,
$!
);
# Report failure and die
# Report failure and die
croak
("
Couldn't create directory '
$path
'
",
croak
("
Couldn't create directory '
$path
'
",
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment