Skip to content

fix path(contains : ) invalid on windows #697

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Aug 8, 2018

Conversation

xxh2000
Copy link
Contributor

@xxh2000 xxh2000 commented Aug 7, 2018

Fixes [issue number]

Changes

  • fix path error bug

@@ -85,6 +85,7 @@ type Result struct {

func NewActiveReader(originPath, realPath, whence string, meta *reader.Meta, msgChan chan<- Result, errChan chan<- error) (ar *ActiveReader, err error) {
rpath := strings.Replace(realPath, string(os.PathSeparator), "_", -1)
rpath = strings.Replace(rpath,":","_",-1)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这样修会导致linux用户的meta出现不兼容的情况,升级会出现错误

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

linux环境一般路径没有冒号吧

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if os.GOOS == "windows"{
   rpath = strings.Replace(rpath,":","_",-1)
}

这样合理些

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

嗯,这样严谨一点

@wonderflow
Copy link
Contributor

fixes #500

@wonderflow wonderflow merged commit 120ad62 into qiniu:master Aug 8, 2018
@xxh2000 xxh2000 deleted the fix_path_err branch August 27, 2018 09:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants