Changeset 6355


Ignore:
Timestamp:
Feb 17, 2009, 3:39:28 PM (16 years ago)
Author:
rwilson
Message:

Made add_csv_header() craete temp file in same directory as input file, so we can always rename.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • anuga_core/source/anuga/lib/add_csv_header/add_csv_header.py

    r6353 r6355  
    3030        raise Exception, msg
    3131
    32     # get a temporary file
    33     (tmp_f, tmp_filename) = tempfile.mkstemp()
     32    # get a temporary file.
     33    # must create in same directory as input file, as we rename it.
     34    input_dir = os.path.dirname(file)
     35    (tmp_f, tmp_filename) = tempfile.mkstemp(dir=input_dir)
    3436    tmp_fd = os.fdopen(tmp_f, 'w')
    3537
Note: See TracChangeset for help on using the changeset viewer.