io.IOBase does not have read, file_d is not used
use log instead of print