Ticket #8673: copystat-missing-import.diff
File copystat-missing-import.diff, 716 bytes (added by , 16 years ago) |
---|
-
django/core/files/move.py
1 1 """ 2 2 Move a file in the safest way possible:: 3 3 4 4 >>> from django.core.files.move import file_move_save 5 5 >>> file_move_save("/tmp/old_file", "/tmp/new_file") 6 6 """ 7 7 8 8 import os 9 import stat 9 10 from django.core.files import locks 10 11 11 12 try: 12 13 from shutil import copystat 13 14 except ImportError: 14 15 def copystat(src, dst): 15 16 """Copy all stat info (mode bits, atime and mtime) from src to dst""" 16 17 st = os.stat(src) 17 18 mode = stat.S_IMODE(st.st_mode) 18 19 if hasattr(os, 'utime'):