def flag_file(path, flag, create=False):
 path = os.path.join(path, JOB_ADMIN)
 path = os.path.join(path, flag)
 if create:
  try:
   f = open(path, 'w')
   f.write('ok\n')
   f.close()
   return True
  except IOError:
   return False
 else:
  return os.path.exists(path)

def flag_file ( path , flag , create = False ) : path = os . path . join ( path , JOB_ADMIN ) path = os . path . join ( path , flag ) if create : try : f = open ( path , 'w' ) f . write ( 'ok\n' ) f . close ( ) return True except IOError : return False else : return os . path . exists ( path )
create verify flag file or return true if it already exists .