detect if a query file exist locally