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
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Update tailx.go
  • Loading branch information
wonderflow authored Aug 8, 2018
commit b1589df732d26e6031dfbc986dc1485de45f9542
5 changes: 4 additions & 1 deletion reader/tailx/tailx.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import (
"os"
"path/filepath"
"regexp"
"runtime"
"strings"
"sync"
"sync/atomic"
Expand Down Expand Up @@ -85,7 +86,9 @@ 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)
if runtime.GOOS == "windows" {
rpath = strings.Replace(rpath, ":", "_", -1)
}
subMetaPath := filepath.Join(meta.Dir, rpath)
subMeta, err := reader.NewMeta(subMetaPath, subMetaPath, realPath, reader.ModeFile, meta.TagFile, reader.DefautFileRetention)
if err != nil {
Expand Down