get_file_data: avoid exposing users to copy_stream invocation