Changeset 2105 in Sophya
- Timestamp:
- Jul 17, 2002, 7:29:53 PM (23 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/SophyaPI/ProgPI/piapp.cc
r2093 r2105 43 43 \verbatim 44 44 csh> spiapp -h 45 SOPHYA Version 1. 1 Revision 0 (V_Fev2001) -- Mar 9 2001 15:45:31cxx46 47 piapp: Interactive data analysis and visualisation program48 Usage: piapp [-nored] [-nosig] [-nosigfpe] [-nosigsegv]49 [-tmpdir TmpDirectory] [-help2tex] [-exec file [args]]45 SOPHYA Version 1.3 Revision 70 (V_Jun2002) -- Jul 16 2002 15:45:53 cxx 46 47 piapp: Interactive data analysis and visualisation program 48 Usage: piapp [-nored] [-nosig] [-nosigfpe] [-nosigsegv] [-hidezswin] 49 [-tmpdir TmpDirectory] [-help2tex] [-exec file [args]] 50 50 -nored : NoRedirect StdOut/StdErr 51 51 -nosig : Don't catch SigFPE, SigSEGV 52 52 -nosigfpe -nosigsegv: Don t catch SigFPE / SigSEGV 53 -hidezswin : Hide Zoom/Stat/ColMap window 53 54 -tmpdir TmpDirectory: defines TMDIR for temporary files 54 55 -help2tex: Create a LaTeX help file (piahelp.tex) … … 133 134 (double)PI_VERSIONNUMBER, (double)skyinit.Version()); 134 135 135 char *vcmds=NULL; 136 char* vcmds=NULL; 137 string vcmd; 136 138 if (fgtmp) { 137 139 if (tmpdir[tmpdir.length()-1] != '/') tmpdir += '/'; // Necessaire pour SetSwapPath 138 stringvcmd = "TMPDIR=" + tmpdir;140 vcmd = "TMPDIR=" + tmpdir; 139 141 vcmds = new char[vcmd.length()+1]; 140 142 strcpy(vcmds, vcmd.c_str()); … … 142 144 } 143 145 146 char* tmpde = getenv("TMPDIR"); 147 char tmpdname[32]; 148 if (tmpde == NULL) tmpde = "./"; 149 if (tmpde[strlen(tmpde)-1] != '/') 150 strcpy(tmpdname, "/PIATmp_XXXXXX"); 151 else 152 strcpy(tmpdname, "PIATmp_XXXXXX"); 153 mktemp(tmpdname); 154 tmpdir = tmpde; 155 tmpdir += tmpdname; 156 tmpdir += '/'; 157 vcmd = "mkdir "; 158 vcmd += tmpde; 159 vcmd += tmpdname; 160 cout << " --piapp: Creating Tmp Directory: " << tmpdir << endl; 161 int rcc = system(vcmd.c_str()); 162 if (rcc != 0) { 163 cout << " --piapp: Error creating TmpDir " << vcmd << " ---> exit !" << endl; 164 return(9); 165 } 166 167 // On cree un repertoire temporaire 144 168 // cout << " DBG-TMPDIR= " << getenv("TMPDIR") << endl; 145 169 146 170 PIStdImgApp * app = new PIStdImgApp(narg, arg); 147 171 // cout << " DBG-2 " << app->ObjMgr()->GetTmpDir() << endl; 148 if (fgtmp) { // Changement de tmpdir 149 cout << " NamedObjMgr::SetTmpDir()+XNTuple::SetSwapPath() " << tmpdir << endl; 150 app->ObjMgr()->SetTmpDir(tmpdir); 151 XNTuple::SetSwapPath(const_cast<char *>(tmpdir.c_str())); 152 } 172 cout << " NamedObjMgr::SetTmpDir()+XNTuple::SetSwapPath() " << tmpdir << endl; 173 app->ObjMgr()->SetTmpDir(tmpdir); 174 XNTuple::SetSwapPath(const_cast<char *>(tmpdir.c_str())); 175 153 176 154 177 … … 239 262 } 240 263 } 264 cout << "\n ------------------------------------------------ \n" 265 << " piapp: Cleaning up ... " << endl; 241 266 242 267 app->RedirectStdOutErr(false); … … 249 274 if (fgtmp) delete[] vcmds; 250 275 251 cout << "\n------------------------------------------------ \n" 276 vcmd = "rm -rf "; 277 vcmd += tmpdir; 278 cout << " --piapp: Removing Tmp Directory: " << tmpdir << endl; 279 rcc = system(vcmd.c_str()); 280 if (rcc != 0) { 281 cout << " --piapp: Error deleting TmpDir " << vcmd << endl; 282 return(9); 283 } 284 285 cout << "------------------------------------------------ \n" 252 286 << "-------- piapp : Exiting .... Rc= " << rc << " -----------\n" 253 287 << "------------------------------------------------ " << endl;
Note:
See TracChangeset
for help on using the changeset viewer.