Rejig Stdio.File dup()ing based on advice from Per Hedbor - thanks!