Skip to content

Commit

Permalink
cmd-index.py: Retry os.open without O_LARGEFILE if not supported.
Browse files Browse the repository at this point in the history
Python under Cygwin doesn't have os.O_LARGEFILE, so if we receive an
'AttributeError' exception trying to open something, just remove
O_LARGEFILE and try again.
  • Loading branch information
lkosewsk committed Jan 10, 2010
1 parent 18c6ffd commit caabf81
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion cmd-index.py
Expand Up @@ -6,7 +6,10 @@
class OsFile:
def __init__(self, path):
self.fd = None
self.fd = os.open(path, os.O_RDONLY|os.O_LARGEFILE|os.O_NOFOLLOW)
try:
self.fd = os.open(path, os.O_RDONLY|os.O_LARGEFILE|os.O_NOFOLLOW)
except AttributeError:
self.fd = os.open(path, os.O_RDONLY|os.O_NOFOLLOW)
#self.st = os.fstat(self.fd)

def __del__(self):
Expand Down

0 comments on commit caabf81

Please sign in to comment.