'Create a file at `path` with given content.
If `dir` is given, it is prepended to `path`. After that, if the
path is relative, it is resolved with respect to
`self.temp_dir`.'

def touch(self, path, dir=None, content=''):

    if dir:
        path = os.path.join(dir, path)
    if (not os.path.isabs(path)):
        path = os.path.join(self.temp_dir, path)
    parent = os.path.dirname(path)
    if (not os.path.isdir(parent)):
        os.makedirs(util.syspath(parent))
    with open(util.syspath(path), 'a+') as f:
        f.write(content)
    return path
