Skip to content
Open
Changes from all commits
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
6 changes: 5 additions & 1 deletion src/multitail2.py
Original file line number Diff line number Diff line change
Expand Up @@ -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__)
Expand All @@ -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
Expand Down