file_handler.py 文件源码

python
阅读 26 收藏 0 点赞 0 评论 0

项目:PlasoScaffolder 作者: ClaudiaSaxer 项目源码 文件源码
def CreateFile(
      self, directory_path: str, file_name: str, filename_suffix: str):
    """Creates a empty file.

    Args:
      directory_path (str): The path to the directory the file should be
          created.
      file_name (str): the name of the new file.
      filename_suffix (str): the suffix of the new file.

    Returns:
      str: the path of the created file
    """
    file_path = self.CreateFilePath(directory_path, file_name,
                                    filename_suffix)

    if not os.path.exists(directory_path):
      self._CreateFolder(directory_path)

    pathlib.Path(file_path).touch()
    return file_path
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号