# Check if Hard/Soft/External link is broken

**URL:** <https://forum.hdfgroup.org/t/check-if-hard-soft-external-link-is-broken/9543>\
**Category:** HDF5 Library\
**Created:** [March 22, 2022, 2:48pm UTC](https://forum.hdfgroup.org/t/check-if-hard-soft-external-link-is-broken/9543 "2022-03-22T14:48:28Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![kerim.khemraev](https://forum.hdfgroup.org/letter_avatar_proxy/v4/letter/k/b9bd4f/32.png) [@kerim.khemraev](https://forum.hdfgroup.org/u/kerim.khemraev)\
**Post date:** [March 22, 2022, 2:48pm UTC](https://forum.hdfgroup.org/t/check-if-hard-soft-external-link-is-broken/9543/1 "2022-03-22T14:48:28Z")

</div>

Hi,

Sometimes I get exception when trying to get broken `Soft/External` links. This usually happens after I move them or move links that these `Soft/External` links point to.

To prevent accesing broken links I think I should somehow get informatiom if the link is valid.  
I know I can use `H5Lexists` that helps me to undestand whether the link exist or not in the give group. But how to check is the link is broken?

---

<div class="post-metadata">

**Author:** ![gheber](https://forum.hdfgroup.org/user_avatar/forum.hdfgroup.org/gheber/32/1919_2.png) [@gheber](https://forum.hdfgroup.org/u/gheber)\
**Post date:** [March 22, 2022, 5:08pm UTC](https://forum.hdfgroup.org/t/check-if-hard-soft-external-link-is-broken/9543/2 "2022-03-22T17:08:58Z")

</div>

Not a perfect match, but [`H5Oexists_by_name`](https://docs.hdfgroup.org/hdf5/develop/group___h5_o.html#title16) might do the trick. OK? G.

---

<div class="post-metadata">

**Author:** ![kerim.khemraev](https://forum.hdfgroup.org/letter_avatar_proxy/v4/letter/k/b9bd4f/32.png) [@kerim.khemraev](https://forum.hdfgroup.org/u/kerim.khemraev)\
**Post date:** [March 22, 2022, 5:25pm UTC](https://forum.hdfgroup.org/t/check-if-hard-soft-external-link-is-broken/9543/3 "2022-03-22T17:25:18Z")

</div>

Thank, this should work
