mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 920637 - FileCopier should create destination directory if it doesn't exist; r=glandium
This commit is contained in:
parent
24e0e87f57
commit
63995b9d13
@ -169,6 +169,17 @@ class FileCopier(FileRegistry):
|
||||
have_symlinks = hasattr(os, 'symlink')
|
||||
destination = os.path.normpath(destination)
|
||||
|
||||
# We create the destination directory specially. We can't do this as
|
||||
# part of the loop doing mkdir() below because that loop munges
|
||||
# symlinks and permissions and parent directories of the destination
|
||||
# directory may have their own weird schema. The contract is we only
|
||||
# manage children of destination, not its parents.
|
||||
try:
|
||||
os.makedirs(destination)
|
||||
except OSError as e:
|
||||
if e.errno != errno.EEXIST:
|
||||
raise
|
||||
|
||||
# Because we could be handling thousands of files, code in this
|
||||
# function is optimized to minimize system calls. We prefer CPU time
|
||||
# in Python over possibly I/O bound filesystem calls to stat() and
|
||||
|
Loading…
Reference in New Issue
Block a user