code: def rename(self, new_dirname=None, new_basename=None):
          
          if not new_basename:
              new_basename = self.new_basename
          if not new_dirname:
              new_dirname = self.dirname
          else:
              new_dirname = os.path.abspath(new_dirname)
          new_abspath = os.path.join(new_dirname, new_basename)
          os.rename(self.abspath, new_abspath)
          
          # 如果成功重命名, 则更新文件信息
          self.abspath = new_abspath
          self.dirname = new_dirname
          self.basename = new_basename
docs: Rename the dirname, basename or their combinations.
          
          **中文文档**
          
          对文件的目录名, 文件夹名, 或它们的组合进行修改。