OK, thanks for the explanation. I don't really care that much as long as
there is a simple way to override the behaviour (and there is!).
For future reference it would probably be a good idea to add this tidbit
about the preceding "!" to the documentation for the OUT parameter.
cheers,
Ed
On Tue, 30 Nov 2010, Malcolm J. Currie wrote:
> NDF2FITS can already overwrite an existing file.
>
> The way around it is to prefix the file name with an exclamation mark,
> suitably escaped in a UNIX shell. For example
>
> % ndf2fits $KAPPA_DIR/m31 comp=d m31.fits
> 1 NDF selected.
>
> % ndf2fits $KAPPA_DIR/m31 comp=d \!m31.fits
> 1 NDF selected.
>
> % ndf2fits $KAPPA_DIR/m31 comp=d m31.fits
> 1 NDF selected.
>
> !! Error creating the output FITS file m31.fits because it already exists.
> ! NDF2FITS: Error converting an NDF into a FITS file.
> ! Application exit status SAI__ERROR, Error
>
> When I saw this last night, I was trying to recall why the default is not to
> trample upon an existing file. It used to irritate me, and likely I had
> correspondence with Bill Pence about it. On UNIX you'd expect that files
> would be overwritten, it is a FITSIO convention that prevents you from
> overwriting the file. CONVERT adheres to the FITSIO approach to avoid
> confusion. I'd prefer that it was the other way around---use the prefix if
> you want to ensure files are not overwritten.
>
> Malcolm
>
|