add write function in fileutils