Changeset 24691 for trunk/magic/remove/src/streaksio.c
- Timestamp:
- Jul 6, 2009, 4:24:20 PM (17 years ago)
- File:
-
- 1 edited
-
trunk/magic/remove/src/streaksio.c (modified) (7 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/magic/remove/src/streaksio.c
r24556 r24691 20 20 memset(sf, 0, sizeof(*sf)); 21 21 22 sf->config = config; 23 sf->program_name = basename(program_name); 24 22 25 if (remove) { 23 26 // remember pointer so that streaksExit can delete temps … … 25 28 } 26 29 27 sf->config = config;28 sf->program_name = basename(program_name);29 30 30 31 // error checking is done by sFileOpen. If a file can't be opened we just exit … … 80 81 } else { 81 82 sf->recWeight = sFileOpen(config, stage, "RECOVERY.WEIGHT", NULL, true); 83 } 84 } 85 if (remove) { 86 sf->inSources = sFileOpen(config, stage, "SOURCES", NULL, false); 87 if (sf->inSources) { 88 inputBasename = basename(sf->inSources->name); 89 sf->outSources = sFileOpen(config, stage, "OUTPUT", inputBasename, true); 82 90 } 83 91 } … … 607 615 streaksExit("", PS_EXIT_DATA_ERROR); 608 616 } 609 617 610 618 bool status; 611 619 in->extname = psMetadataLookupStr(&status, in->header, "EXTNAME"); … … 929 937 if (!replicate(sfiles->outWeight, sfiles->inWeight)) { 930 938 psError(PM_ERR_SYS, false, "failed to replicate outImage."); 939 return false; 940 } 941 } 942 943 if (sfiles->outSources) { 944 if (!replicate(sfiles->outSources, sfiles->inSources)) { 945 psError(PM_ERR_SYS, false, "failed to replicate outSources."); 931 946 return false; 932 947 } … … 997 1012 } 998 1013 1014 if (sfiles->outSources) { 1015 if (!swapOutputToInput(sfiles->inSources, sfiles->outSources)) { 1016 psError(PM_ERR_SYS, false, "failed to swap instances for sources."); 1017 return false; 1018 } 1019 } 1020 999 1021 if (!swapOutputToInput(sfiles->inImage, sfiles->outImage)) { 1000 1022 psError(PM_ERR_SYS, false, "failed to swap instances for Image."); 1001 1023 return false; 1002 1024 } 1025 1003 1026 1004 1027 return true; … … 1042 1065 if (sfiles->outImage) { 1043 1066 deleteFile(sfiles->outImage); 1067 } 1068 1069 if (sfiles->outSources) { 1070 deleteFile(sfiles->outSources); 1044 1071 } 1045 1072
Note:
See TracChangeset
for help on using the changeset viewer.
