[Swift-devel] exit codes treated as output data rather than status indicators

Ben Clifford benc at hawaga.org.uk
Fri Mar 27 04:54:46 CDT 2009


I played with this patch a few weeks ago and never did anything with it.

http://www.ci.uchicago.edu/~benc/tmp/lcc-feature-exit-codes-nonfatal-1.patch

It allows status codes for application executables to be staged out as a 
file, rather than treated as success/failure, as demonstrated in the below 
fragment. If exitcode= is not specified, then the exitcode is handle as 
before.

Other causes of failure (such as missing files) continue to cause 
execution errors as before.

(messagefile t, messagefile ec) greeting() { 
    app {
        _false stdout=@filename(t) exitcode=@ec;
    }
}

(outfile, ecfile) = greeting();
int ec = readData(ecfile);
trace("Exit code",ec);

-- 



More information about the Swift-devel mailing list