ornladios / ADIOS

The old ADIOS 1.x code repository. Look for ADIOS2 for new repo
https://csmd.ornl.gov/adios
Other
54 stars 41 forks source link

Python: Is File Open? #73

Closed ax3l closed 8 years ago

ax3l commented 8 years ago

@yyalli currently it is not possible to query if a f=adios.File object is still open (e.g., after a call to .close()).

One way would be to implement a cast of adios.File to bool (as h5py does it) which leads True if the internal f.fp is != NULL and False otherwise.

Alternatively, an f.is_open() call could be implemented with the same behaviour.

This is necessary to finish our HDFCompass pull request (https://github.com/HDFGroup/hdf-compass/issues/155).

jychoi-hpc commented 8 years ago

Just implemented is_open() as well as boolean cast functions (nonzero and bool) for adios file.

Jong Youl Choi Scientific Data Group Computer Science and Math Division Oak Ridge National Laboratory Homepage: http://www.ornl.gov/~jyc/

On Jul 6, 2016, at 10:05 AM, Axel Huebl notifications@github.com<mailto:notifications@github.com> wrote:

@yyallihttps://github.com/yyalli currently it is not possible to query if a adios.File object is still open.

One way would be to implement a cast of adios.File to bool (as h5py does it) which leads True if the internal fp is != NULL and False otherwise.

Alternatively, an f.ishttp://f.is_open() call could be implemented with the same behaviour.

This is necessary to finish our HDFCompass pull request (HDFGroup/hdf-compass#155https://github.com/HDFGroup/hdf-compass/issues/155).

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHubhttps://github.com/ornladios/ADIOS/issues/73, or mute the threadhttps://github.com/notifications/unsubscribe/ADfdB_LxFIFTb7dWtYZDL7zMsnXBlWePks5qS7YcgaJpZM4JGHPL.

ax3l commented 8 years ago

Hi Jong, that's awesome and quick! We will try it tomorrow, thank you so much.

ax3l commented 8 years ago

wonderful, I tested it and it works! b1038dea0145e46474b610163a184c000c371566

ax3l commented 8 years ago

ccing @michaelsippel