From: <ds...@us...> - 2008-01-30 19:26:31
|
Revision: 2794 http://sashimi.svn.sourceforge.net/sashimi/?rev=2794&view=rev Author: dshteyn Date: 2008-01-30 11:26:29 -0800 (Wed, 30 Jan 2008) Log Message: ----------- Fix problems with calling mktemp that were causing things to fail under linux. Modified Paths: -------------- trunk/trans_proteomic_pipeline/src/Quantitation/ASAPRatio/PvalueModel/PvalueModel.cxx trunk/trans_proteomic_pipeline/src/Validation/ProteinProphet/ProteinProphet.cpp trunk/trans_proteomic_pipeline/src/Visualization/InteractParser/InteractParser.cxx trunk/trans_proteomic_pipeline/src/common/util.c Modified: trunk/trans_proteomic_pipeline/src/Quantitation/ASAPRatio/PvalueModel/PvalueModel.cxx =================================================================== --- trunk/trans_proteomic_pipeline/src/Quantitation/ASAPRatio/PvalueModel/PvalueModel.cxx 2008-01-30 17:19:17 UTC (rev 2793) +++ trunk/trans_proteomic_pipeline/src/Quantitation/ASAPRatio/PvalueModel/PvalueModel.cxx 2008-01-30 19:26:29 UTC (rev 2794) @@ -169,7 +169,7 @@ get initial guess */ if(pngFile != NULL) { - tmpFile1 += "tmp_raw_data.XXXXXX.dat"; + tmpFile1 += "tmp_raw_data.dat.XXXXXX"; // do this in designated tmp dir, if any replace_path_with_webserver_tmp(tmpFile1); stdstring_mktemp(tmpFile1); @@ -361,7 +361,7 @@ */ if(pngFile != NULL) { - tmpFile2 += "tmp_gaussian_fit.XXXXXX.dat"; + tmpFile2 += "tmp_gaussian_fit.dat.XXXXXX"; // do this in designated tmp dir, if any replace_path_with_webserver_tmp(tmpFile2); stdstring_mktemp(tmpFile2); @@ -381,7 +381,7 @@ if(strstr(pngFile, ".ps") != NULL) psIndx = 1; - tmpFile3 += ".XXXXXX.gnuplot"; + tmpFile3 += ".gnuplot.XXXXXX"; // do this in designated tmp dir, if any replace_path_with_webserver_tmp(tmpFile3); stdstring_mktemp(tmpFile3); Modified: trunk/trans_proteomic_pipeline/src/Validation/ProteinProphet/ProteinProphet.cpp =================================================================== --- trunk/trans_proteomic_pipeline/src/Validation/ProteinProphet/ProteinProphet.cpp 2008-01-30 17:19:17 UTC (rev 2793) +++ trunk/trans_proteomic_pipeline/src/Validation/ProteinProphet/ProteinProphet.cpp 2008-01-30 19:26:29 UTC (rev 2794) @@ -1193,7 +1193,7 @@ datafile = OUTFILE+"_senserr.txt"; // populate the filename to get an output file if (PLOT_PNG && getIsInteractiveMode() && !PAPER_FIGURES) { // it's going to get deleted, so write to tmp dir - datafile += ".XXXXXX.tmp"; + datafile += ".tmp.XXXXXX"; replace_path_with_webserver_tmp(datafile); // write this in tmpdir stdstring_mktemp(datafile); // replace XXXXXX with unique random stuff } @@ -2222,7 +2222,7 @@ imagefile.erase(dot); } imagefile += ".png"; - std::string scriptfile = imagefile + ".script.XXXXXX.tmp"; + std::string scriptfile = imagefile + ".script.tmp.XXXXXX"; replace_path_with_webserver_tmp(scriptfile); // write this in tmpdir stdstring_mktemp(scriptfile); // replace XXXXXX with unique random stuff Modified: trunk/trans_proteomic_pipeline/src/Visualization/InteractParser/InteractParser.cxx =================================================================== --- trunk/trans_proteomic_pipeline/src/Visualization/InteractParser/InteractParser.cxx 2008-01-30 17:19:17 UTC (rev 2793) +++ trunk/trans_proteomic_pipeline/src/Visualization/InteractParser/InteractParser.cxx 2008-01-30 19:26:29 UTC (rev 2794) @@ -229,14 +229,14 @@ - char suffix[] = ".XXXXXX.tmp"; + char suffix[] = ".tmp.XXXXXX"; int olen = (int)(strlen(outfile_)+strlen(suffix)+1); char* tmp_outfile = new char[olen]; strcpy(tmp_outfile, outfile_); strcat(tmp_outfile, suffix); // do this in designated tmp dir, if any replace_path_with_webserver_tmp(tmp_outfile,olen); - mktemp(tmp_outfile); + mkstemp(tmp_outfile); unlink(tmp_outfile); // sometimes old cygwin files won't reopen for write ofstream fout(tmp_outfile); Modified: trunk/trans_proteomic_pipeline/src/common/util.c =================================================================== --- trunk/trans_proteomic_pipeline/src/common/util.c 2008-01-30 17:19:17 UTC (rev 2793) +++ trunk/trans_proteomic_pipeline/src/common/util.c 2008-01-30 19:26:29 UTC (rev 2794) @@ -434,11 +434,11 @@ } // -// mktemp for std::string, should have XXXXXX in it somewhere for replacement +// mktemp for std::string, should have XXXXXX in it at the end for replacement // void stdstring_mktemp(std::string &XXXXXX_template) { char *c=strdup(XXXXXX_template.c_str()); - mktemp(c); + mkstemp(c); XXXXXX_template = c; free(c); } @@ -448,14 +448,14 @@ // caller must delete[] // char *construct_tmpfile_name(const char *basename) { - char suffix[] = ".XXXXXX.tmp"; + char suffix[] = ".tmp.XXXXXX"; int olen=(int)(strlen(basename)+strlen(suffix)+1); char* outfile = new char[olen]; strcpy(outfile, basename); strcat(outfile, suffix); // do this in designated tmp dir, if any replace_path_with_webserver_tmp(outfile,olen); - mktemp(outfile); + mkstemp(outfile); return outfile; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |