RFC: h5dump add option to redirect DDL output

all,

We would like to have your inputs on a new option that will be added to h5dump.

Currently, when the "-o F" option is used, the DDL text is output to the screen and only raw data is output to a text file. A corollary to this would be to redirect the DDL text to a file as well. Suppressing or redirecting the DDL text should be combinable with all other options. This document proposes to create a new short option "-O F" and a new long option "--ddl=F", if F is NULL (no filename is specified i.e.; "---ddl" or "-O"), h5dump will ignore the DDL text and only dump the raw data (by default to stdout). The corollary option would then be the name of the file F.

See attached RFC for details.

RFC_h5dump-redirect-ddl.pdf (506 KB)

···

--
Thank you!
--pc

Currently, when the "-o F" option is used, the DDL text is output to the
screen and only raw data is output to a text file. A corollary to this would
be to redirect the DDL text to a file as well. Suppressing or redirecting
the DDL text should be combinable with all other options.

Pipes?

h5dump -o data.txt foo.h5 > ddl.txt

- Rhys

Rhys,

Yes, that is the current capability, the request was to capture the DDL to a
file so that the stdout would not show any text.

A by-product is that one could send the DDL to a file and show just data from
stdout.

Or if you had a sequence of commands in a script, all DDL and data would go to
files and stdout would just show the the commands that were executed.

More control for the user.

Allen

···

On Tuesday, February 05, 2013 09:13:13 AM Rhys Ulerich wrote:

> Currently, when the "-o F" option is used, the DDL text is output to the
> screen and only raw data is output to a text file. A corollary to this
> would be to redirect the DDL text to a file as well. Suppressing or
> redirecting the DDL text should be combinable with all other options.

Pipes?

h5dump -o data.txt foo.h5 > ddl.txt

- Rhys

_______________________________________________
Hdf-forum is for HDF software users discussion.
Hdf-forum@hdfgroup.org
http://mail.hdfgroup.org/mailman/listinfo/hdf-forum_hdfgroup.org

...the request was to capture the DDL to a file so that the stdout would not show any text.

h5dump -o data.txt restart0.h5 > /dev/null

A by-product is that one could send the DDL to a file and show just data from
stdout.

(h5dump -o data.txt restart0.h5 > ddl.txt ; cat data.txt)

Or if you had a sequence of commands in a script, all DDL and data would go to
files and stdout would just show the the commands that were executed.

h5dump -o >(cat >> data.txt) restart0.h5 > >(cat >> ddl.txt)

This command can be repeated ad nauseum. It appends to data.txt and
ddl.txt on each invocation.

My response to the RFC is that this stuff is best left to the shell.
The bare minimum support in h5dump is present-- that is, the ability
to separate the data and the DDL onto separate files. With that in
place, I'd personally not chance the source code of the mostly-sunset
h5dump utility. Everything you've described is an intermediate-level,
five minute exercise in using pipes.

- Rhys

Hi Rhys,

Good point and great comments! I like your idea of making the tool simple
and leave specific to applications or user's scripts.

When we first received the request, we recommended exact what you proposed
here. However, the request was from our paying customers and the solution of
using pipe in scripts will not work for their production line. We also think it is a
convenient option for many other users.

Thanks
--pc

···

On 2/5/2013 9:53 AM, Rhys Ulerich wrote:

...the request was to capture the DDL to a file so that the stdout would not show any text.

h5dump -o data.txt restart0.h5 > /dev/null

A by-product is that one could send the DDL to a file and show just data from
stdout.

(h5dump -o data.txt restart0.h5 > ddl.txt ; cat data.txt)

Or if you had a sequence of commands in a script, all DDL and data would go to
files and stdout would just show the the commands that were executed.

h5dump -o >(cat >> data.txt) restart0.h5 > >(cat >> ddl.txt)

This command can be repeated ad nauseum. It appends to data.txt and
ddl.txt on each invocation.

My response to the RFC is that this stuff is best left to the shell.
The bare minimum support in h5dump is present-- that is, the ability
to separate the data and the DDL onto separate files. With that in
place, I'd personally not chance the source code of the mostly-sunset
h5dump utility. Everything you've described is an intermediate-level,
five minute exercise in using pipes.

- Rhys

_______________________________________________
Hdf-forum is for HDF software users discussion.
Hdf-forum@hdfgroup.org
http://mail.hdfgroup.org/mailman/listinfo/hdf-forum_hdfgroup.org