diff --git a/common/file.py b/common/file.py new file mode 100644 index 0000000000000000000000000000000000000000..65251aab198e72b77cf142eca3b1c113a4cacddb --- /dev/null +++ b/common/file.py @@ -0,0 +1,21 @@ +#!/usr/bin/env python +# -*- coding: UTF-8 -*- +# cython:language_level=3 + +import os +from common.config import Config + +# file operation class +class FileOperation: + + @staticmethod + def remove_txt_file(file_name): + ''' + empty file + ''' + if os.path.exists(Config.get_output_path() + file_name): + os.remove(Config.get_output_path() + file_name) + else: + # os.mkdir(Config.get_output_path() + file_name) + file = open(Config.get_output_path() + file_name,'w') + file.close()