Changeset 6767 for trunk/psLib/src/fits/psFits.c
- Timestamp:
- Apr 4, 2006, 9:52:55 AM (20 years ago)
- File:
-
- 1 edited
-
trunk/psLib/src/fits/psFits.c (modified) (6 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psLib/src/fits/psFits.c
r6354 r6767 7 7 * @author Robert DeSonia, MHPCC 8 8 * 9 * @version $Revision: 1.5 2$ $Name: not supported by cvs2svn $10 * @date $Date: 2006-0 2-08 01:03:34$9 * @version $Revision: 1.53 $ $Name: not supported by cvs2svn $ 10 * @date $Date: 2006-04-04 19:52:42 $ 11 11 * 12 12 * Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii … … 166 166 psFits* fits = psAlloc(sizeof(psFits)); 167 167 fits->fd = fptr; 168 fits->writable = (iomode == READWRITE); 168 169 psMemSetDeallocator(fits,(psFreeFunc)fitsFree); 169 170 … … 252 253 return false; 253 254 } 254 255 return psFitsMoveExtNum(fits,psFitsGetSize(fits),false); 255 int size = psFitsGetSize(fits); 256 if (size == 0) { // empty file -- no action needed 257 return true; 258 } else { 259 return psFitsMoveExtNum(fits,size-1,false); 260 } 256 261 } 257 262 … … 329 334 } 330 335 336 if (! fits->writable) { 337 psError(PS_ERR_IO, true, 338 PS_ERRORTEXT_psFits_NOT_WRITABLE); 339 return false; 340 } 341 331 342 // move to the specified HDU 332 343 if (! psFitsMoveExtNum(fits,extnum,relative) ) { … … 361 372 } 362 373 374 if (! fits->writable) { 375 psError(PS_ERR_IO, true, 376 PS_ERRORTEXT_psFits_NOT_WRITABLE); 377 return false; 378 } 379 363 380 // move to the specified HDU 364 381 if (! psFitsMoveExtName(fits,extname) ) { … … 442 459 psError(PS_ERR_BAD_PARAMETER_NULL, true, 443 460 PS_ERRORTEXT_psFits_NULL); 461 return PS_FITS_TYPE_NONE; 462 } 463 464 if (! fits->writable) { 465 psError(PS_ERR_IO, true, 466 PS_ERRORTEXT_psFits_NOT_WRITABLE); 444 467 return PS_FITS_TYPE_NONE; 445 468 }
Note:
See TracChangeset
for help on using the changeset viewer.
