[Swift-devel] [Bug 291] New: Add a exists() function to test for file existence
Justin M Wozniak
wozniak at mcs.anl.gov
Sun Apr 3 16:56:54 CDT 2011
Ok, John, you can give this a try in trunk if you like. The syntax for
the built-in is @exists, it takes a string and returns a boolean.
Justin
On Sat, 2 Apr 2011, Justin M Wozniak wrote:
>
> I have a prototype of this, I'll get it checked in later today.
> Justin
>
> On Fri, 1 Apr 2011, John Dennis wrote:
>
>> Michael,
>>
>> This type of function would be great to have.
>>
>> John
>> On Apr 1, 2011, at 11:51 AM, Michael Wilde wrote:
>>
>>> Basically as far as I understand: the presence or absence of a particular
>>> data file within the inout dataset is to be used to determine whether the
>>> code to process that dataset subsection gets invoked or not:
>>>
>>> if (exists("extra.data")) {
>>> DataFile extraInput<"extra.data">;
>>> extraResult = analyze(extraInput);
>>> }
>>>
>>> The above is my assumption based on a phone call. We can and should
>>> verify the assumption with a simple example.
>>>
>>> I also thought we can try this today by seeing if extraInput can be an
>>> array, mapped to zero items if nothing to do and 1 item if something to
>>> do. That would at least let us test the use case.
>>>
>>> John, can you verify if the example Swift lines above are what you are
>>> looking for here?
>>>
>>> - Mike
>>>
>>> ----- Original Message -----
>>>> On Fri, 2011-04-01 at 10:51 -0500, Michael Wilde wrote:
>>>>
>>>>> - we should first verify that exists() will solve the NCAR need in a
>>>>> sufficiently clean way
>>>>
>>>> I think this is important. Can we get a description of the problem
>>>> instead of a (otherwise) random proposal for a solution?
>>>
>>> --
>>> Michael Wilde
>>> Computation Institute, University of Chicago
>>> Mathematics and Computer Science Division
>>> Argonne National Laboratory
>>>
>>
>> _______________________________________________
>> Swift-devel mailing list
>> Swift-devel at ci.uchicago.edu
>> http://mail.ci.uchicago.edu/mailman/listinfo/swift-devel
>
>
--
Justin M Wozniak
More information about the Swift-devel
mailing list