'Emulates the UNIX touch command.
Creates a file, if it does not exist. Otherwise changes its access and
modification times to the current time.
Fails if used with the directories or the parent directory of the given
file does not exist.'

def touch(self, path):

    path = self._absnorm(path)
    if os.path.isdir(path):
        self._error(("Cannot    touch    '%s'    because    it    is    a    directory." % path))
    if (not os.path.exists(os.path.dirname(path))):
        self._error(("Cannot    touch    '%s'    because    its    parent    directory    does    not    exist." % path))
    if os.path.exists(path):
        mtime = round(time.time())
        os.utime(path, (mtime, mtime))
        self._link("Touched    existing    file    '%s'.", path)
    else:
        open(path, 'w').close()
        self._link("Touched    new    file    '%s'.", path)
