Writing of a file to fetch data from the function stat