[Swift-devel] Problem using @extractint() on derived file

Michael Wilde wilde at mcs.anl.gov
Tue Feb 24 16:29:19 CST 2009


Sorry, I think I see the problem. @extractint() wants a file-mapped 
object (ie marker type), not a filename string. Now (I think) it seems 
to work.

Is readData and readData2 the same?

On 2/24/09 3:33 PM, Mihael Hategan wrote:
> Sorry. Didn't look properly.
> 
> Yes, this happens because @f can be resolved before f can be, so swift
> will happily do the extractint before echo finishes.
> 
> I don't have a solution yet.
> 
> On Tue, 2009-02-24 at 15:24 -0600, Michael Wilde wrote:
>> The file doesnt exist - its created in the script, and hence I would 
>> expect it to be placed back in the dir that I ran swift from.
>>
>> (But Ive been testing further, in my original scripts, and am seeing 
>> confusing results, so I need to sort out and isolate.
>>
>> I do this "y=f(x); rc=extractint(y)" pattern in a loop, thus I needed to 
>> make the file name unique (else I get the "file already in cache" 
>> error). So I switched to an anonymous file, and then started getting the 
>> "no such file" error.
>>
>> Whats confusing is I may have seen a csae similar to whats below that 
>> did work, so I need to do more testing to isolate when it works and when 
>> it fails.
>>
>> Can you duplicate the failure with the simple script below?
>>
>> - Mike
>>
>>
>> On 2/24/09 3:12 PM, Mihael Hategan wrote:
>>> Where is that file with respect to:
>>> - the script
>>> - the place you are running this from
>>>
>>> On Tue, 2009-02-24 at 15:07 -0600, Michael Wilde wrote:
>>>> This script:
>>>>
>>>> ---
>>>>
>>>> type file;
>>>>
>>>> app (file out) echo (string s) { echo s stdout=@out; }
>>>>
>>>> file f<"a">;
>>>> int i;
>>>>
>>>> f = echo("123");
>>>> i = @extractint(@f);
>>>> trace("i=", i);
>>>>
>>>> ---
>>>>
>>>> produces:
>>>>
>>>> Swift svn swift-r2552 cog-r2303 
>>>>
>>>>  
>>>>
>>>> RunID: 20090224-1455-k1vj4uy7 
>>>>
>>>> Progress: 
>>>>
>>>> Execution failed: 
>>>>
>>>>          Reading integer content of file 
>>>>
>>>> Caused by: 
>>>>
>>>>          a (No such file or directory) 
>>>>
>>>>
>>>>
>>>> ---
>>>>
>>>> I seem to get the same behavior from readData, and the same if I 
>>>> explicitly specify "a" as the argument to @extractint();
>>>>
>>>> Is this because @extractint() is not waiting for "f" to get produced?
>>>>
>>>> Ive extracted this example while debugging a script that uses an app to 
>>>> test the termination condition of an iterate loop.
>>>>
>>>> - Mike
>>>> _______________________________________________
>>>> Swift-devel mailing list
>>>> Swift-devel at ci.uchicago.edu
>>>> http://mail.ci.uchicago.edu/mailman/listinfo/swift-devel
> 



More information about the Swift-devel mailing list