def is_writeable(path, check_parent=False):
 if (os.access(path, os.F_OK) and os.access(path, os.W_OK)):
  return True
 if (os.access(path, os.F_OK) and (not os.access(path, os.W_OK))):
  return False
 if (check_parent is False):
  return False
 parent_dir = os.path.dirname(path)
 if (not os.access(parent_dir, os.F_OK)):
  return False
 return os.access(parent_dir, os.W_OK)

def is_writeable ( path , check_parent = False ) : if ( os . access ( path , os . F_OK ) and os . access ( path , os . W_OK ) ) : return True if ( os . access ( path , os . F_OK ) and ( not os . access ( path , os . W_OK ) ) ) : return False if ( check_parent is False ) : return False parent_dir = os . path . dirname ( path ) if ( not os . access ( parent_dir , os . F_OK ) ) : return False return os . access ( parent_dir , os . W_OK )
check if a given path is writeable by the current user .