Use withFile to ensure devnull is closed