Converted fileio to a text file struct with related functions.