From 6bfdd52397420c28cb97a3d89501fe1e8131b07b Mon Sep 17 00:00:00 2001 From: Dawid Dziurla Date: Mon, 23 Dec 2019 19:35:42 +0100 Subject: [PATCH] Use gcla/tail on Windows and tail command on unix --- tailfile_unix.go | 24 ++++++++++++++++++++++++ tailfile.go => tailfile_windows.go | 0 2 files changed, 24 insertions(+) create mode 100644 tailfile_unix.go rename tailfile.go => tailfile_windows.go (100%) diff --git a/tailfile_unix.go b/tailfile_unix.go new file mode 100644 index 0000000..10d0446 --- /dev/null +++ b/tailfile_unix.go @@ -0,0 +1,24 @@ +// Copyright 2019 Graham Clark. All rights reserved. Use of this source +// code is governed by the MIT license that can be found in the LICENSE +// file. + +package termshark + +import ( + "os" + "os/exec" +) + +//====================================================================== + +func TailFile(file string) error { + cmd := exec.Command("tail", "-f", file) + cmd.Stdout = os.Stdout + return cmd.Run() +} + +//====================================================================== +// Local Variables: +// mode: Go +// fill-column: 78 +// End: diff --git a/tailfile.go b/tailfile_windows.go similarity index 100% rename from tailfile.go rename to tailfile_windows.go