Utility function to test existence of files