Commit c0bf33cd47a9fc54cd783e345e2dab7f5576c50c

Authored by André Araújo
1 parent f20d5d4e
Exists in master

Adiciona função que verifica existência de um arquivo

Showing 1 changed file with 10 additions and 0 deletions   Show diff stats
pyutil.py
... ... @@ -77,6 +77,16 @@ def printStackTrace(fromFile):
77 77 log(error, 4)
78 78 return 1
79 79  
  80 +# @def Função que verifica se um arquivo existe
  81 +# @param string filePath: Caminho do arquivo a ser checado
  82 +# @return bool Verdadeiro se o arquivo existir, Falso caso contrário
  83 +def file_exists(filePath):
  84 + from os.path import isfile, exists
  85 + if ((isfile(filePath) == 1) and (exists(filePath) == 1)):
  86 + return True
  87 + else:
  88 + return False
  89 +
80 90 def file_rename(filename, fromfile):
81 91 from shutil import move
82 92 newFilename = ""
... ...