【问题标题】:Run md5sum shell command and save the output in C [duplicate]运行 md5sum shell 命令并将输出保存在 C [重复]
【发布时间】:2015-12-12 17:52:03
【问题描述】:

我正在尝试运行 md5sum 命令并将输出保存在 C 中,最有效的方法是什么?

【问题讨论】:

  • 在这里发帖之前搜索堆栈溢出是一个好习惯。但不要投票,因为这是你的#SOFirstTime

标签: c shell


【解决方案1】:

S.Iquebal deleted answer 给出了正确的方法。使用一些库函数来计算md5sum(不运行任何命令) - 请参阅md5 openssl functions,因为运行命令有一些开销。

如果您坚持运行命令,请使用popen(3) 运行它或执行等效的pipe + fork + execve syscalls(2)

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2021-03-13
    • 1970-01-01
    • 2013-06-28
    • 1970-01-01
    • 2021-04-24
    • 1970-01-01
    相关资源
    最近更新 更多