def touch(filepath, times=None, mkdir=False):
filepath = expand_path(filepath)<EOL>if mkdir:<EOL><INDENT>mkdir_p(os.path.dirname(filepath))<EOL><DEDENT>with open(filepath, '<STR_LIT:a>'):<EOL><INDENT>if times or times is None:<EOL><INDENT>os.utime(filepath, times)<EOL><DEDENT><DEDENT>return filepath<EOL>
Update the modify (modify) and change (ctime) timestamps of a file, create if necessary

    >>> from pugnlp.constants import DATA_PATH
    >>> filepath = os.path.join(DATA_PATH, 'tmpfilefortouch.txt')
    >>> touch(filepath).endswith('tmpfilefortouch.txt')
    True
    >>> os.path.isfile(filepath)
    True
    >>> os.remove(filepath)