Truncate file through EOS using XRootD File interface #69
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This (draft) PR targets the bug reported here.
As explained in this other issue, the call to
truncate
is not supported in EOS, and the file has to exist before callingtruncate
.This can be done by using the
File
interface, as suggested here.As the problem was spotted in uproot5, one solution could be to implement the wrapper there, but not having access to a
XRootD.client.File
object (since now uproot depends onfsspec
) prevents this.This PR attempts to fix the problem by extending the behavior of the
_touch
function on thefsspec-xrootd
side: the idea is to implement the necessary behavior only if we are trying to write a file on EOS.Since I'm not familiar with the code, feedback is more than welcome, especially in case there are less invasive ways to do this and possible caveats of this procedure that I might not be considering.
It should also be noted that, for this to work, I think other changes would be needed either on the uproot or fsspec side: as in
FileSink
, thefsspec.open
function is called with modew+b
(see here), the error in here is raised.