##// END OF EJS Templates
windows: check target type before actual unlinking to follow POSIX semantics...
FUJIWARA Katsunori -
r19159:1b329f8c stable
parent child Browse files
Show More
@@ -344,6 +344,12 b' def spawndetached(args):'
344 344 def unlink(f):
345 345 '''try to implement POSIX' unlink semantics on Windows'''
346 346
347 if os.path.isdir(f):
348 # use EPERM because it is POSIX prescribed value, even though
349 # unlink(2) on directories returns EISDIR on Linux
350 raise IOError(errno.EPERM,
351 "Unlinking directory not permitted: '%s'" % f)
352
347 353 # POSIX allows to unlink and rename open files. Windows has serious
348 354 # problems with doing that:
349 355 # - Calling os.unlink (or os.rename) on a file f fails if f or any
General Comments 0
You need to be logged in to leave comments. Login now