Fix can_write + check tmpdir