(*This program has two functions, a readfile and a writefile.\n The readfile function Expects a filename as a string. It then returns the entire content of the file as a single string.The writefile function expects the input as a string (the outputfile name) and the string to be output*) (*There is a test program provided, which in fact is the SML version of the `cp' command*) fun readfile (filename) = let val infilestream = TextIO.openIn(filename) val argument = TextIO.inputAll(infilestream) in argument end; fun writefile (filename,outstring) = let val outfilestream = TextIO.openOut(filename) in TextIO.output(outfilestream,outstring) end; fun test(infile,outfile)= let val data=readfile(infile) in writefile(outfile,data) end;