【问题标题】:How to fix "HDF5-DIAG: Error unable to open file"?如何修复“HDF5-DIAG:错误无法打开文件”?
【发布时间】:2020-03-11 20:21:14
【问题描述】:

尝试运行 MEEP 模拟时出现以下错误:

HDF5-DIAG: Error detected in HDF5 (1.10.5) thread 0:
  #000: H5F.c line 509 in H5Fopen(): unable to open file
    major: File accessibilty
    minor: Unable to open file
  #001: H5Fint.c line 1498 in H5F_open(): unable to open file: time = Fri Nov 15 16:56:54 2019
, name = '*.h5', tent_flags = 0
    major: File accessibilty
    minor: Unable to open file
  #002: H5FD.c line 734 in H5FD_open(): open failed
    major: Virtual File Layer
    minor: Unable to initialize object
  #003: H5FDsec2.c line 346 in H5FD_sec2_open(): unable to open file: name = '*.h5', errno = 2, error message = 'No such file or directory', flags = 0, o_flags = 0
    major: File accessibilty
    minor: Unable to open file
h5topng error: error opening HD5 file
rm: *.h5: No such file or directory

有人可以告诉我如何解决这个/理解错误吗?

提前致谢

【问题讨论】:

    标签: c hdf5 meep


    【解决方案1】:

    免责声明:我从未与 MEEP 合作过。

    该错误似乎表明该文件不存在:

    #003: H5FDsec2.c line 346 in H5FD_sec2_open(): unable to open file: name = '*.h5', errno = 2, error message = 'No such file or directory', flags = 0, o_flags = 0
    

    所以这似乎是核心问题。 再往下看,似乎传递给H5FD_sec2_open() 的文件名是*.h5,这很可能是一个无效的文件名。我希望您想将诸如 foo.h5relative/path/to/foo.h5/absolute/path/to/foo.h5 之类的内容传递给 H5FD_sec2_open() 函数。

    通配符通常不被这些函数处理/解释。这是一个更高级别的概念,需要“更多的文件系统访问权限”才能使用它来做任何有用的事情,因为收到该通配符的人必须获取文件和目录列表并找出哪些文件系统条目与该通配符匹配。

    因此,我的回答是:确保将有效的文件路径传递给相应的文件打开函数。 此外,您可能希望扩展您的程序,以便它在将其传递给相应的 MEEP 函数之前检查它是否是有效文件,这使您可以更好地控制错误和用户反馈。

    【讨论】:

      猜你喜欢
      • 2011-10-19
      • 1970-01-01
      • 1970-01-01
      • 2014-06-18
      • 2019-03-29
      • 2015-03-17
      • 2020-07-26
      • 2023-04-06
      相关资源
      最近更新 更多