Add the WriteFile in util package and add its test case