Use File explicitly for open
add spec tests for user_data paramater