let check_extension x ext = let lx = String.length x and lext = String.length ext in lx > lext + 1 && x.[lx - lext - 1] = '.' && String.is_suffix x ext