Ignore error on make directory in Globus Flow when directory exists

9 views
Skip to first unread message

David Deepwell

unread,
May 24, 2022, 1:07:13 PMMay 24
to Discuss
Hi all,

I have a Globus Flow which creates a directory using the mkdir action provider. This is all fine except that I do not want an error to be raised when the directory already exists. It doesn’t look like an option exists in the action provider to ignore this case and continue with the work flow. Rather, I can catch the error with the ActionFailedException to continue, but this designates the action as failed in the log which is undesired. Has anyone else come up against this with other solutions?

Cheers,
David

David Deepwell, PhD
Software Developer
Research Computing Services
Department of Information Technologies
University of Calgary


Rudyard Richter

unread,
May 25, 2022, 1:20:06 PMMay 25
to Discuss, David Deepwell
Hi David,

Thanks for your question. Unfortunately Transfer/GCS don't have any flag to set to make this operation fail silently, and Flows doesn't have a way to force an action's return status to a different value. I think the latter is technically feasible but isn't on our roadmap. We'll take this question into consideration for planning future work.

Best,
Rudyard

Lev Gorenstein

unread,
May 25, 2022, 1:25:17 PMMay 25
to Rudyard Richter, Discuss, David Deepwell
Can the action provider for 'mkdir' be tweaked to execute 'mkdir -p'
under the hood? I am not sure how to do it cross-platform fashion, but
on Linux it's been a good friend for ages.

Lev

--
It turns out that moose can navigate 50-degree slopes rather better
than men on skis with 80-pound packs.
-- http://www.supertopo.com/tr/West-Fork-Ruth-Glacier-Mt-Huntington-East-Ridge/t10480n.html

On Wed, 25 May 2022, Rudyard Richter wrote:

> ---- External Email: Use caution with attachments, links, or sharing data ----
> david.d...@ucalgary.ca<mailto:david.d...@ucalgary.ca>
>
>
>
> --
> You received this message because you are subscribed to the Google Groups "Discuss" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to discuss+u...@globus.org<mailto:discuss+u...@globus.org>.
>

Karl Kornel

unread,
May 25, 2022, 1:27:01 PMMay 25
to Discuss

Or, is there a way for Globus to provide a “Path exists” action, with instructions on how to use this to only trigger the directory creation if the path does not already exist?

 

~ Karl

To unsubscribe from this group and stop receiving emails from it, send an email to discuss+u...@globus.org.

Rudyard Richter

unread,
May 25, 2022, 1:52:13 PMMay 25
to Discuss, akko...@stanford.edu, david.d...@ucalgary.ca, l...@purdue.edu
Good question, Lev—that's what I'm indicating in the first part, since "under the hood" in this case is ultimately a call to the Transfer API. See here: https://docs.globus.org/api/transfer/file_operations/#make_directory
...and unfortunately there is no parameter for the `mkdir -p` behavior. I'll ask if this can be added to Transfer, so we can percolate the behavior up through Automate.

Also to Karl's point, for instance, you could actually use the ls provider to get a directory listing, and filter for the name of the directory you want to create, then use a Choice state to indicate whether it exists already. This seems unnecessarily complicated compared to adding the `mkdir -p` behavior, but if you really wanted to have that functionality at the moment that would be the way to do it.

Rudyard


>
>
>
> --
> You received this message because you are subscribed to the Google Groups "Discuss" group.

> To unsubscribe from this group and stop receiving emails from it, send an email to discuss+u...@globus.org<mailto:discuss+unsubscribe@globus.org>.


>

--
You received this message because you are subscribed to the Google Groups "Discuss" group.

Reply all
Reply to author
Forward
0 new messages