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
6a107188
Commit
6a107188
authored
Oct 11, 2008
by
Magnus Svensson
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
WL#4189 Add retry logic to mkpath to avoid temporary permission denied problems
parent
8873148d
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
30 additions
and
1 deletion
+30
-1
mysql-test/lib/My/File/Path.pm
mysql-test/lib/My/File/Path.pm
+30
-1
No files found.
mysql-test/lib/My/File/Path.pm
View file @
6a107188
...
...
@@ -22,8 +22,10 @@ our @EXPORT= qw / rmtree mkpath copytree /;
use
File::
Find
;
use
File::
Copy
;
use
File::
Spec
;
use
Carp
;
use
My::
Handles
;
use
My::
Platform
;
sub
rmtree
{
my
(
$dir
)
=
@_
;
...
...
@@ -58,7 +60,34 @@ sub rmtree {
sub
mkpath
{
goto
&
File::Path::
mkpath
;
my
$path
;
foreach
my
$dir
(
File::
Spec
->
splitdir
(
@_
)
)
{
#print "dir: $dir\n";
if
(
$dir
=~
/^[a-z]:/i
){
# Found volume ie. C:
$path
=
$dir
;
next
;
}
$path
=
File::
Spec
->
catdir
(
$path
,
$dir
);
#print "path: $path\n";
next
if
-
d
$path
;
# Path already exist
next
if
mkdir
(
$path
);
# mkdir worked
# mkdir failed, try one more time
next
if
mkdir
(
$path
);
# mkdir failed again, try two more time after sleep(s)
sleep
(
1
);
next
if
mkdir
(
$path
);
sleep
(
1
);
next
if
mkdir
(
$path
);
# Report failure and die
croak
("
Couldn't create directory '
$path
'
",
"
after 4 attempts and 2 sleep(1): $!
");
}
};
...
...
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