Skip to content

Instantly share code, notes, and snippets.

@Laeeth
Created January 11, 2015 03:09
Show Gist options
  • Save Laeeth/5925d46945c9c8fde923 to your computer and use it in GitHub Desktop.
Save Laeeth/5925d46945c9c8fde923 to your computer and use it in GitHub Desktop.
see contents of hdf5 data file
import hdf5.wrap;
import hdf5.bindings.enums;
import std.stdio;
import std.file;
void main(string[] args)
{
if (args.length!=2)
{
stderr.writefln("syntax is h5cat <filename>");
return;
}
auto fn=args[1];
if (!exists(fn))
{
stderr.writefln("file does not exist; quitting");
return;
}
auto file=H5F.open(fn,H5F_ACC_RDWR, H5P_DEFAULT);
writefln("%s",cast(string[])objectList(file));
H5F.close(file);
writefln("* quitting");
return;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment