allow binary or string for filename
replace unexported startlink_ret type