I am attempting to compare files in a directory using SML. Using the TextIO library is fairly easy but I need to compare the files at the bit level. That is, a binary compare. I am using a function similar to this:
fun listDir (s) = let fun loop (ds) = (case OS.FileSys.readDir (ds) of '' => [] before OS.FileSys.closeDir (ds) | file => file::loop (ds)) val ds = OS.FileSys.openDir (s) in loop (ds) handle e => (OS.FileSys.closeDir (ds); raise (e)) end
to list all the files in a given directory. But now, I need to look at the bits in each file. Any suggestions?
Take a look at the
BinIOstructure.