return status from command "open"

Jennifer Adams jma at COLA.IGES.ORG
Mon Sep 17 07:30:00 EDT 2007


Here's how the GDS does it:


function gopen(dataset)
'sdfopen 'dataset
if (!rc); say 'file opened with sdfopen'; return; endif
'xdfopen 'dataset
if (!rc); say 'file opened with xdfopen'; return; endif
'open 'dataset
if (!rc); say 'file opened with open'; return; endif
say "error: couldn't open " dataset


ga-> gopen file.ctl

--
Jennifer M. Adams
IGES/COLA
4041 Powder Mill Road, Suite 302
Calverton, MD 20705
jma at cola.iges.org


On Sep 17, 2007, at 4:26 AM, bernd.becker at METOFFICE.GOV.UK wrote:

> Hello,
>
> Can I sway "open" to return something to figure
> if the file.ctl in question exists or not?
>
> iostat='open bob.ctl'
>
> say 'iostat for bob is :'iostat
>
> --> iostat for bob is : bob.ctl not found'
>
> or similar.
>
> many thanks,
> Bernd.
>
>
>
> --
> Bernd Becker   The Monthly Outlook
> Met Office  FitzRoy Road  Exeter   Devon EX1 3PB  United Kingdom
> Tel.: +44 (0) 1392 884511 Fax: +44 (0)870 900 5050
> E-mail:bernd.becker at metoffice.gov.uk -  http://www.metoffice.gov.uk



-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://gradsusr.org/pipermail/gradsusr/attachments/20070917/f3a3863c/attachment.html 


More information about the gradsusr mailing list