@@ -321,36 +321,8 @@ function get_dataset(g::Group, name::String)
321321 return get_dataset (f, group_offset (g), g, name)
322322 end
323323
324- # Use lookup_link and getoffset for simplified resolution
325324 link = lookup_link (g, name)
326- link === nothing && throw (KeyError (name))
327-
328- if is_external_link (link)
329- # For external links, provide informative error message
330- throw (ArgumentError (LazyString (
331- " get_dataset cannot be used on external links.\n " ,
332- " Link \" " , name, " \" points to:\n " ,
333- " • External file: \" " , link. external_file, " \"\n " ,
334- " • Object path: \" " , link. path, " \"\n " ,
335- " Use f[\" " , name, " \" ] to access the external data directly."
336- )))
337- end
338-
339- # Try to get the offset (resolves soft links, returns offset for hard links)
340- offset = getoffset (g, link; erroroninvalid= false )
341- if offset == UNDEFINED_ADDRESS
342- # Either uninitialized hard link or unresolvable soft link
343- if is_soft_link (link)
344- throw (ArgumentError (LazyString (
345- " get_dataset cannot be used on soft links that don't point to regular datasets.\n " ,
346- " Link \" " , name, " \" points to: \" " , link. path, " \"\n " ,
347- " Use f[\" " , name, " \" ] to access the linked data directly."
348- )))
349- else
350- throw (KeyError (name)) # Uninitialized hard link
351- end
352- end
353-
325+ offset = getoffset (g, link)
354326 return get_dataset (f, offset, g, name)
355327end
356328
0 commit comments