Use File instead of deprecated fs