Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Truncate file through EOS using XRootD File interface #69

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

maxgalli
Copy link

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 calling truncate.
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 on fsspec) prevents this.
This PR attempts to fix the problem by extending the behavior of the _touch function on the fsspec-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, the fsspec.open function is called with mode w+b (see here), the error in here is raised.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant