Skip to content

Windows watch isnotexist file, then create it and write some text, but can't print the text #117

@xkeyideal

Description

@xkeyideal

Windows OS, go 1.7.4

cfg := tail.Config{ReOpen: true, MustExist: false, Follow: true}
t, err := tail.TailFile("D:\log\hotelprice\server\hotelprice_log4.log", cfg)
if err != nil {
fmt.Println(err)
}
for line := range t.Lines {
fmt.Println(line.Text)
}

the hotelprice_log4.log file is not exist.

  1. create the file hotelprice_log4.log
  2. open the file, then write contents, close it
    but the program can't print the contents

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions