netcdf-c/ncdump/tst_nccopy_w3.sh
Dennis Heimbigner 2420b69a83 Fix nccopy to use NC_PERSIST so that -w actually persists the output.
re: Issue https://github.com/Unidata/netcdf-c/issues/1365

At some point (4.6.1) we changed the diskless handling of flags
and added a new NC_PERSIST flag. Looks like we did not fix all
occurrences of the old flag set, specifically for 'nccopy -w' command.
Also added some tests (tst_nccopy_w{3,4}.sh) for this situation.
2019-03-15 12:05:27 -06:00

21 lines
628 B
Bash
Executable File

#!/bin/sh
if test "x$srcdir" = x ; then srcdir=`pwd`; fi
. ../test_common.sh
set -e
echo "*** Test nccopy -w on netcdf classic file"
echo "*** create nccopy_w3.nc from ref_nccopy_w.cdl..."
${NCGEN} -lb -o nccopy_w3.nc -N nccopy_w $srcdir/ref_nccopy_w.cdl
echo "*** diskless copy nccopy_w3.nc to nccopy_w3c.nc..."
${NCCOPY} -w nccopy_w3.nc nccopy_w3c.nc
echo "*** Convert nccopy_w3c.nc to nccopy_w3c.cdl..."
${NCDUMP} -n nccopy_w nccopy_w3c.nc > nccopy_w3c.cdl
echo "*** comparing ref_nccopy_w.cdl nccopy_w3c.cdl..."
diff -b -w $srcdir/ref_nccopy_w.cdl nccopy_w3c.cdl
rm -f nccopy_w3c.cdl nccopy_w3.nc nccopy_w3c.nc
exit 0