Skip to content

Commit

Permalink
fix problems with windows paths for pipes ...
Browse files Browse the repository at this point in the history
  • Loading branch information
TheCrazyT committed Aug 7, 2018
1 parent 1d4909d commit f445f5b
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
9 changes: 8 additions & 1 deletion roboschool/multiplayer.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,14 @@
from os import mkfifo
from os import open

MULTIPLAYER_FILES_DIR = "/tmp"
if os.name=="nt":
MULTIPLAYER_FILES_DIR = r"c:\tmp"
else:
MULTIPLAYER_FILES_DIR = "/tmp"

if not os.path.isdir(MULTIPLAYER_FILES_DIR):
raise Exception("Please check that: %s exists." % MULTIPLAYER_FILES_DIR)


class SharedMemoryClientEnv:
"""
Expand Down
2 changes: 2 additions & 0 deletions roboschool/winfifo.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ def open(name,options):
dbg("open %s GENERIC_READ" % (name))
fileName = PIPE_PREFIX % name
fileName = fileName.replace("\\","/")
fileName = fileName.replace(":","_")
try:
overlapped = pywintypes.OVERLAPPED()
#TODO: this check is more a workaround than a real solution!
Expand Down Expand Up @@ -108,6 +109,7 @@ def mkfifo(name):
# | win32pipe.PIPE_NOWAIT
fileName = PIPE_PREFIX % name
fileName = fileName.replace("\\","/")
fileName = fileName.replace(":","_")
sa = pywintypes.SECURITY_ATTRIBUTES()
sa.SetSecurityDescriptorDacl ( 1, None, 0 )
#for i in range(0,1):
Expand Down

0 comments on commit f445f5b

Please sign in to comment.