```file``` can be null here.