comparison mx/commands.py @ 8183:4b11a0983557

fixed issue with deleting temp files on Windows
author Doug Simon <doug.simon@oracle.com>
date Fri, 08 Mar 2013 16:57:46 +0100
parents e0db99483b35
children 74896b25297a
comparison
equal deleted inserted replaced
8182:e0db99483b35 8183:4b11a0983557
384 if exists(jdks): 384 if exists(jdks):
385 for e in os.listdir(jdks): 385 for e in os.listdir(jdks):
386 jreLibDir = join(jdks, e, 'jre', 'lib') 386 jreLibDir = join(jdks, e, 'jre', 'lib')
387 if exists(jreLibDir): 387 if exists(jreLibDir):
388 # do a copy and then a move to get atomic updating (on Unix) of graal.jar in the JRE 388 # do a copy and then a move to get atomic updating (on Unix) of graal.jar in the JRE
389 _, tmp = tempfile.mkstemp(suffix='', prefix='graal.jar', dir=jreLibDir) 389 fd, tmp = tempfile.mkstemp(suffix='', prefix='graal.jar', dir=jreLibDir)
390 shutil.copyfile(graalJar, tmp) 390 shutil.copyfile(graalJar, tmp)
391 os.close(fd)
391 shutil.move(tmp, join(jreLibDir, 'graal.jar')) 392 shutil.move(tmp, join(jreLibDir, 'graal.jar'))
392 393
393 # run a command in the windows SDK Debug Shell 394 # run a command in the windows SDK Debug Shell
394 def _runInDebugShell(cmd, workingDir, logFile=None, findInOutput=None, respondTo={}): 395 def _runInDebugShell(cmd, workingDir, logFile=None, findInOutput=None, respondTo={}):
395 newLine = os.linesep 396 newLine = os.linesep