parameters: (src, dst)
docstring: Copy all stat info (mode bits, atime, mtime, flags) from src to dst
docstring_summary: Copy all stat info (mode bits, atime, mtime, flags) from src to dst
docstring_tokens: Copy all stat info ( mode bits atime mtime flags ) from src to dst
function: def copystat(src, dst):
      """Copy all stat info (mode bits, atime, mtime, flags) from src to 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'):
          try:
              os.chflags(dst, st.st_flags)
          except OSError, why:
              if (not hasattr(errno, 'EOPNOTSUPP') or
                  why.errno != errno.EOPNOTSUPP):
                  raise
function_tokens: 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' ) : try : os . chflags ( dst , st . st_flags ) except OSError , why : if ( not hasattr ( errno , 'EOPNOTSUPP' ) or why . errno != errno . EOPNOTSUPP ) : raise