def lmtime(filepath, mtime):
    'Set mtime for files, while not de-referencing symlinks.\n\n        To overcome absence of os.lutime\n\n        Works only on linux and OSX ATM\n        '
    from .cmd import WitlessRunner
    smtime = time.strftime('%Y%m%d%H%M.%S', time.localtime(mtime))
    lgr.log(3, 'Setting mtime for %s to %s == %s', filepath, mtime, smtime)
    WitlessRunner().run(['touch', '-h', '-t', ('%s' % smtime), filepath])
    filepath = Path(filepath)
    rfilepath = filepath.resolve()
    if (filepath.is_symlink() and rfilepath.exists()):
        lgr.log(3, 'File is a symlink to %s Setting mtime for it to %s', rfilepath, mtime)
        os.utime(str(rfilepath), (time.time(), mtime))
Set mtime for files, while not de-referencing symlinks.

To overcome absence of os.lutime

Works only on linux and OSX ATM
def lmtime(filepath, mtime):
    'Set mtime for files, while not de-referencing symlinks.\n\n        To overcome absence of os.lutime\n\n        Works only on linux and OSX ATM\n        '
    from .cmd import WitlessRunner
    smtime = time.strftime('%Y%m%d%H%M.%S', time.localtime(mtime))
    lgr.log(3, 'Setting mtime for %s to %s == %s', filepath, mtime, smtime)
    WitlessRunner().run(['touch', '-h', '-t', ('%s' % smtime), filepath])
    filepath = Path(filepath)
    rfilepath = filepath.resolve()
    if (filepath.is_symlink() and rfilepath.exists()):
        lgr.log(3, 'File is a symlink to %s Setting mtime for it to %s', rfilepath, mtime)
        os.utime(str(rfilepath), (time.time(), mtime))