comparison tools/mira4/mira4.py @ 19:8487d70e82aa draft

Uploaded v0.0.3 preview 1, target MIRA v4.0.2
author peterjc
date Wed, 21 May 2014 06:56:06 -0400
parents 381aa262c8cb
children aeb3e35f8236
comparison
equal deleted inserted replaced
18:381aa262c8cb 19:8487d70e82aa
89 89
90 #At time of writing, this is at the end of a file, 90 #At time of writing, this is at the end of a file,
91 #but could be followed by a space in future... 91 #but could be followed by a space in future...
92 text = text.replace("-DI:trt=/tmp", "-DI:trt=" + tempfile.gettempdir()) 92 text = text.replace("-DI:trt=/tmp", "-DI:trt=" + tempfile.gettempdir())
93 93
94 #Want to try to ensure this gets written to disk before MIRA attempts
95 #to open it - any networked file system may impose a delay...
94 handle = open(manifest, "w") 96 handle = open(manifest, "w")
95 handle.write(text) 97 handle.write(text)
96 handle.flush() 98 handle.flush()
99 os.fsync(handle.fileno())
97 handle.close() 100 handle.close()
98 101
99 102
100 def log_manifest(manifest): 103 def log_manifest(manifest):
101 """Write the manifest file to stderr.""" 104 """Write the manifest file to stderr."""