def copystat(src, dst):
 st = os.stat(src)
 mode = stat.S_IMODE(st.st_mode)
 if hasattr(os, 'utime'):
  os.utime(dst, (st.st_atime, st.st_mtime))
 if hasattr(os, 'chmod'):
  os.chmod(dst, mode)
 if (hasattr(os, 'chflags') and hasattr(st, 'st_flags')):
  os.chflags(dst, st.st_flags)

def copystat ( src , dst ) : st = os . stat ( src ) mode = stat . S_IMODE ( st . st_mode ) if hasattr ( os , 'utime' ) : os . utime ( dst , ( st . st_atime , st . st_mtime ) ) if hasattr ( os , 'chmod' ) : os . chmod ( dst , mode ) if ( hasattr ( os , 'chflags' ) and hasattr ( st , 'st_flags' ) ) : os . chflags ( dst , st . st_flags )
copy all stat info from src to dst .