tail_windows.go

 1// Copyright (c) 2019 FOSS contributors of https://github.com/nxadm/tail
 2// +build windows
 3
 4package tail
 5
 6import (
 7	"os"
 8
 9	"github.com/nxadm/tail/winfile"
10)
11
12// Deprecated: this function is only useful internally and, as such,
13// it will be removed from the API in a future major release.
14//
15// OpenFile proxies a os.Open call for a file so it can be correctly tailed
16// on POSIX and non-POSIX OSes like MS Windows.
17func OpenFile(name string) (file *os.File, err error) {
18	return winfile.OpenFile(name, os.O_RDONLY, 0)
19}