diff --git a/src/multitail2.py b/src/multitail2.py index a0a941a..4605bf9 100644 --- a/src/multitail2.py +++ b/src/multitail2.py @@ -4,6 +4,9 @@ import os import random import six +import sys + +is_windows = sys.platform == 'win32' __version__ = "1.5.2" logger = logging.getLogger(__name__) @@ -27,7 +30,8 @@ def _close(self): def _open(self, path, skip_to_end = True, offset = None): """Open `path`, optionally seeking to the end if `skip_to_end` is True.""" - fh = os.fdopen(os.open(path, os.O_RDONLY | os.O_NONBLOCK)) + flags = os.O_RDONLY if is_windows else (os.O_RDONLY | os.O_NONBLOCK) + fh = os.fdopen(os.open(path, flags)) # If the file is being opened for the first time, jump to the end. # Otherwise, it is being reopened after a rotation, and we want