SML 在位级别比较文件
我正在尝试使用 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
列出给定目录中的所有文件。 但现在,我需要查看每个文件中的位。 有什么建议么?
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?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
看一下
BinIO
结构。Take a look at the
BinIO
structure.