Skip to content

Commit

Permalink
Add error when // is missing from xrootd path (#295)
Browse files Browse the repository at this point in the history
* Add error when // is missing from xrootd path

Co-authored-by: Jerry Ling <[email protected]>

---------

Co-authored-by: Jerry Ling <[email protected]>
  • Loading branch information
tamasgal and Moelf authored Nov 29, 2023
1 parent 394ab1a commit 5dc0d10
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/root.jl
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ function ROOTFile(filename::AbstractString; customstructs = Dict("TLorentzVector
fobj = if startswith(filename, r"https?://")
HTTPStream(filename)
elseif startswith(filename, "root://")
length(findall("//", filename)) == 2 || error("The xrootd URL is illegal: missing the '//' separator between the server and the path (e.g. 'root://server:1234//path/to/file.root')")
sep_idx = findlast("//", filename)
baseurl = filename[8:first(sep_idx)-1]
filepath = filename[last(sep_idx):end]
Expand Down

0 comments on commit 5dc0d10

Please sign in to comment.