Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/opengl/4.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
SML在位级别比较文件_Sml_Smlnj - Fatal编程技术网

SML在位级别比较文件

SML在位级别比较文件,sml,smlnj,Sml,Smlnj,我正在尝试使用SML比较目录中的文件。使用TextIO库相当简单,但我需要在位级别比较文件。也就是说,二进制比较。我使用的函数与此类似: 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.

我正在尝试使用SML比较目录中的文件。使用TextIO库相当简单,但我需要在位级别比较文件。也就是说,二进制比较。我使用的函数与此类似:

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
列出给定目录中的所有文件。但是现在,我需要查看每个文件中的位。有什么建议吗?

看一下