Symlinks on windows?

后端 未结 10 1570
轻奢々
轻奢々 2020-11-29 01:09

Does anyone know of a way to make/read symbolic links across versions of win32 from Python? Ideally there should be a minimum amount of platform specific code, as I need my

10条回答
  •  谎友^
    谎友^ (楼主)
    2020-11-29 01:52

    here is the link containing all methods of kernel32.dll

    http://www.geoffchappell.com/studies/windows/win32/kernel32/api/

    I used CreateHardLinkA on Windows xp sp3, it worked!

    import ctypes if os.path.exists(link_file): os.remove(link_file)

    dll = ctypes.windll.LoadLibrary("kernel32.dll")
    dll.CreateHardLinkA(link_file, _log_filename, 0)
    

提交回复
热议问题