JuliaIO / HDF5.jl

Save and load data in the HDF5 file format from Julia
https://juliaio.github.io/HDF5.jl
MIT License
386 stars 140 forks source link

Base.parent does not work if dataset contains a backslash #1161

Closed mkitti closed 1 month ago

mkitti commented 1 month ago

For a dataset with a name of "/X/somelab/RW10557/031021/Pos0/segmentation/RegB/045/E10\", Base.parent does not work. It attempts to look for "/X/somelab/RW10557/031021/Pos0/segmentation/RegB/045/E10" since that is the result of dirname.

Instead we should strictly look for /. This is still possibly incorrect since the name of the dataset could contain a /.

mkitti commented 1 month ago

xref: HDF5 Path Names and Navigation.

A BNF grammar for path names

PathName ::= AbsolutePathName | RelativePathName
Separator ::= "/" ["/"]*
AbsolutePathName ::= Separator [ RelativePathName ]
RelativePathName ::= Component [ Separator RelativePathName ]*
Component ::= "." | Name
Name ::= Character+ - {"."}
Character ::= {c: c in {{ legal ASCII characters } - {'/'}}