From: Dave B. <dav...@us...> - 2007-08-20 21:18:31
|
Update of /cvsroot/wigwam/wigwam-base/bin-scripts In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv30076 Modified Files: sub.in Log Message: delete non-writable files as needed. Index: sub.in =================================================================== RCS file: /cvsroot/wigwam/wigwam-base/bin-scripts/sub.in,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** sub.in 24 Aug 2001 22:53:20 -0000 1.3 --- sub.in 20 Aug 2007 21:18:21 -0000 1.4 *************** *** 9,13 **** if (!open(I, $input_file)) { ! print STDERR "$0: error opening '$input_file': $!\n"; exit(1); } --- 9,13 ---- if (!open(I, $input_file)) { ! print STDERR "$0: error opening '$input_file' for reading: $!\n"; exit(1); } *************** *** 15,18 **** --- 15,19 ---- my $mode = (stat (I))[2]; + if (-f $output_file && ! -w _) { unlink($output_file); } if (!open(O, ">$output_file")) { print STDERR "$0: error opening '$output_file': $!\n"; *************** *** 32,36 **** if (!close(O)) { ! print STDERR "$0: error writing to '$output_file': $!\n"; exit(1); } --- 33,37 ---- if (!close(O)) { ! print STDERR "$0: error writing to '$output_file' for writing: $!\n"; exit(1); } |