shell - fortran 中的便携式创建日期和 md5 哈希
问题描述
我需要在由创建或修改(都很好)日期和md5哈希组成的文件上盖章。为了在fortran(fortran 2003)中为data
我正在使用的文件获取这些参数
! -- execute shell commands
call execute_command_line("md5 -q "//trim(data)//">"//trim(data)//".md5")
call execute_command_line("date -r "//trim(data)//">>"//trim(data)//".md5")
! -- read extracted info from a tmp file
open(10,file=trim(data)//".md5")
read(10,"(A)") data_file_md5
read(10,"(A)") data_file_mtime
close(10)
! -- clean up
call execute_command_line("rm -rf "//trim(data)//".md5")
但是,最近我了解到这不是一种可移植的方法。事实上,它在 Linux 或 macOS 下甚至都不能移植,主要是因为date -r
不是随处可用,但我也对execute_command_line
和md5 -q
.
因此,我的问题是如何使创建日期和 md5 哈希的确定更可靠。
解决方案
推荐阅读
- c - 可变大小堆栈框架的组装(关于局部变量的堆栈)
- c - 从链表中删除的更有效方法
- angular - 重新路由到它时,角度4调用组件方法
- lua - Roblox - FE 零件创建者脚本不起作用
- windows-10 - 查找文件路径,然后使用该文件路径复制+粘贴文件
- node.js - 如何链接 Promise 和多个异步请求?
- neo4j - 使用 GraphAware NLP 运行“ga.nlp.annotate”时出现“java.lang.OutOfMemoryError: Java heap space”
- c++ - 使用 C++ 对 2D 图像进行 DFT - 不好的结果
- python - Python Pulp - 避免解决方案中的重复条目
- java - 此方法必须返回 double 类型的结果