Author: semor Date: Fri Oct 24 16:19:17 2008 New Revision: 7967 URL: http://svn.gna.org/viewcvs/relax?rev=7967&view=rev Log: Modified the '-l' and '-t' options so they check for an existing file and don't overwrite it. This was proposed by Edward in a post at: https://mail.gna.org/public/relax-devel/2008-10/msg00087.html (Message ID: 7f080ed10810240648p19b83da1x4c8990acf1834c5b@xxxxxxxxxxxxxx) Modified: 1.3/relax Modified: 1.3/relax URL: http://svn.gna.org/viewcvs/relax/1.3/relax?rev=7967&r1=7966&r2=7967&view=diff ============================================================================== --- 1.3/relax (original) +++ 1.3/relax Fri Oct 24 16:19:17 2008 @@ -203,9 +203,9 @@ # The log file. log_file = options.log - # Verify that logging won't erase the script used (a '.py' file) - if options.log.endswith(".py"): - log_file = 'LOG_FILE' + # Fail if the file already exists. + if access(log_file, F_OK): + raise relax_errors.RelaxFileOverwriteError, (log_file, 'force_flag') else: log_file = None @@ -218,9 +218,9 @@ # The tee file. tee_file = options.tee - # Verify that tee won't erase the script used (a '.py' file) - if options.tee.endswith(".py"): - tee_file = 'TEE_FILE' + # Fail if the file already exists. + if access(tee_file, F_OK): + raise relax_errors.RelaxFileOverwriteError, (tee_file, 'force_flag') else: tee_file = None