-
Notifications
You must be signed in to change notification settings - Fork 22
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
Feature request: Recursive mkdir (-p/--parents) support #475
Comments
I'd probably punt on "-p" support for mkdir until the API itself supported it. Doing an artificial recursive For example, if you create one of n directories and get an error, what do you do? Try to issue more API requests to roll it back? What if those also fail? Not really something I want to own as a client library. |
This is a great point, and one that I hadn't even considered since I don't plan on hopping to it today. If we were dedicated to doing this client-side, I would say we should just error-out in this case, leaving the endpoint in whatever state the series of # use a for-loop to create "${epid}:/some/path/to/file/name"
cur="${epid}:/some"
for x in path to file name; do
cur="${cur}/${x}"
globus mkdir "$cur"
done which is the same exact thing (slightly worse if you don't If it's documented that |
My two cents FWIW: I'd agree with @jaswilli that the various error conditions make this scary and punt worthy unless there's someone requesting it with good reason. I'd imagine in most cases if it is going to fail, it would at the first-level, but those intermediate states seem unhappy. Is actual If per @sirosen 's argument that this is a convenience tool then the key is documentation especially when reporting the error at run-time (rather than relying on /a priori/ documented behavior that explains what could happen). Ideally it would report what we believe to be the final state after the error-based abort. |
From the utilitarian user prospective, I'd say that it would be totally OK if a failed My C is rusty and almost non-existent, but a cursory read of |
Either done in a client library or done in the Transfer backend, this will have to be done in stages and run the risk of failing partway through. GridFTP MKDIR doesn't support recursive mkdir, so it's just a matter of who does the work of supporting it. However, I'd like to know whether or not we're possibly going to get backend support for this before we seriously consider a pure client-side solution. Otherwise, we'll have a client-side implementation of the I have several reasons for preferring API support. Primarily it being available to all API consumers and the possibility of defining a distinct response payload for |
We've had this come in as a feature request via support, and it is desirable, but not as "obvious" or "trivial" as it might at first appear.
Without diving into why Transfer itself doesn't support recursive mkdir (or, by extension, why FTP and GridFTP don't), here are my basic thoughts on doing this purely client side:
This is the easy case and hardly worth discussing.
Proper JSON output format handling requires proxifying the transfer interaction to wrap multiple responses. Recursive
ls
does this and works fine (we've never had a complaint about it), but it also makesglobus ls
probably our third most complicated command, after login and activate.ls
and recursivemkdir
seems like a good goal.If it's not too hard, the thing we probably would want to do is treat recursive ls and recursive mkdir as a family of commands which iterate over API calls and return wrapped responses. This will lead to less code and a better overall user experience as command behaviors stay consistent.
Could this even make its way into the SDK? (Is that something we want? I don't think so. Helping people do recursive ls and watching them blow up their memory space seems really unwise.)
The text was updated successfully, but these errors were encountered: