Ignore:
Timestamp:
Jun 3, 2015, 2:12:34 PM (4 years ago)
Author:
cameron
Message:

Make /tmp files overwritable by others.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • icGREP/icgrep-devel/QA/greptest.py

    r4338 r4591  
    1919
    2020
    21 import sys, subprocess, os, optparse, re, codecs
     21import sys, subprocess, os, optparse, re, codecs, stat
    2222import xml.parsers.expat
    2323
     
    2626def start_element_open_file(name, attrs):
    2727        global outf
     28        global outfpath
    2829        global in_datafile
    2930        if name == 'datafile':
     
    3637                        print "Expecting id attribute for datafile, but none found."
    3738                        exit(-1)
    38                 outf = codecs.open(os.path.join(options.datafile_dir, filename), encoding='utf-8', mode='w')
     39                outfpath = os.path.join(options.datafile_dir, filename)
     40                outf = codecs.open(outfpath, encoding='utf-8', mode='w')
    3941                in_datafile = True
    4042
     
    4547def end_element_close_file(name):
    4648        global outf
     49        global outfpath
    4750        global in_datafile
    4851        if name == 'datafile':
    4952                outf.close()
     53                os.chmod(outfpath, stat.S_IRUSR | stat.S_IWUSR | stat.S_IRGRP | stat.S_IWGRP | stat.S_IROTH | stat.S_IWOTH)
    5054                in_datafile = False
    5155
Note: See TracChangeset for help on using the changeset viewer.