[ExM Users] create directory based on loop index

Tim Armstrong tim.g.armstrong at gmail.com
Wed Jul 30 10:04:41 CDT 2014


You'll also need to convert the loop index to a string with fromint(i) or
sprintf("%i", i) or similar.

It's probably better and less error-prone in general to ensure that any
functions that create their output files also create the directory.  App
functions should already do this (if they don't, it's a bug).

 - Tim


On Wed, Jul 30, 2014 at 9:52 AM, Justin M Wozniak <wozniak at mcs.anl.gov>
wrote:

>
> Yes but do it like this:
>
> foreach i in [0:99]{
>     create_dir("dir"+i) =>
>        do_some_op(inargs, "dir"+i+"/"+outfile);
> }
>
>
>
> On 07/30/2014 09:50 AM, Ketan Maheshwari wrote:
>
> In T, is it possible to create directory on the fly within a foreach loop
> like so:
>
>  foreach i in [0:99]{
>     create_dir("dir"+i);
>     do_some_op(inargs, "dir"+i+"/"+outfile);
> }
>
>  Thanks,
> Ketan
>
>
> _______________________________________________
> ExM-user mailing listExM-user at lists.mcs.anl.govhttps://lists.mcs.anl.gov/mailman/listinfo/exm-user
>
>
>
> --
> Justin M Wozniak
>
>
> _______________________________________________
> ExM-user mailing list
> ExM-user at lists.mcs.anl.gov
> https://lists.mcs.anl.gov/mailman/listinfo/exm-user
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/exm-user/attachments/20140730/12befc84/attachment.html>


More information about the ExM-user mailing list