To write data to a file the unix system needs to open the file first. Once you have finished writing to that file unix will close it. In spec, as in unix, files will be opened the first time they are used and kept opened until a close instruction is executed. Nevertheless spec will control …