Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
dms3
go-ds-flatfs
Commits
1eb10548
Commit
1eb10548
authored
Jan 18, 2017
by
Kevin Atkinson
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
In Move function, output a warning when encountering an unexpected file.
parent
05f0240c
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
3 deletions
+4
-3
convert.go
convert.go
+4
-3
No files found.
convert.go
View file @
1eb10548
...
@@ -110,14 +110,15 @@ func Move(oldPath string, newPath string, out io.Writer) error {
...
@@ -110,14 +110,15 @@ func Move(oldPath string, newPath string, out io.Writer) error {
if
err
!=
nil
{
if
err
!=
nil
{
return
err
return
err
}
}
if
inf
.
IsDir
()
||
fn
==
"
SHARDING
"
||
fn
==
"_
README
"
{
if
inf
.
IsDir
()
||
fn
==
SHARDING
_FN
||
fn
==
README
_FN
{
//
if
we are a director or generated file just remove it
// we are a
n empty
director
y
or generated file
so
just remove it
err
:=
os
.
Remove
(
oldPath
)
err
:=
os
.
Remove
(
oldPath
)
if
err
!=
nil
{
if
err
!=
nil
{
return
err
return
err
}
}
}
else
{
}
else
{
// else move it
// else we found something unexpected, so to be safe just move it
log
.
Warningf
(
"found unexpected file in datastore directory:
\"
%s
\"
, moving anyway"
,
fn
)
newPath
:=
filepath
.
Join
(
newDS
.
path
,
fn
)
newPath
:=
filepath
.
Join
(
newDS
.
path
,
fn
)
err
:=
osrename
.
Rename
(
oldPath
,
newPath
)
err
:=
osrename
.
Rename
(
oldPath
,
newPath
)
if
err
!=
nil
{
if
err
!=
nil
{
...
...
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