Show More
@@ -565,11 +565,13 def link_or_copy(src, dst): | |||||
565 | # linking, or 'src' and 'dst' are on different filesystems. |
|
565 | # linking, or 'src' and 'dst' are on different filesystems. | |
566 | shutil.copy(src, dst) |
|
566 | shutil.copy(src, dst) | |
567 |
|
567 | |||
568 |
def ensure_dir_exists(path, mode=0o7 |
|
568 | def ensure_dir_exists(path, mode=0o755): | |
569 | """ensure that a directory exists |
|
569 | """ensure that a directory exists | |
570 |
|
570 | |||
571 | If it doesn't exist, try to create it and protect against a race condition |
|
571 | If it doesn't exist, try to create it and protect against a race condition | |
572 | if another process is doing the same. |
|
572 | if another process is doing the same. | |
|
573 | ||||
|
574 | The default permissions are 755, which differ from os.makedirs default of 777. | |||
573 | """ |
|
575 | """ | |
574 | if not os.path.exists(path): |
|
576 | if not os.path.exists(path): | |
575 | try: |
|
577 | try: |
General Comments 0
You need to be logged in to leave comments.
Login now