dongshi1188 2016-09-17 18:17
浏览 24
已采纳

什么是.exe〜扩展名?

I noticed that go build is now creating a .exe and a .exe~

I've googled and found nothing, this only started happening after one of the bazaar libraries was used as a dependency to a package I am using.

Do I need the .exe~ for anything? Can I delete it?

  • 写回答

1条回答 默认 最新

  • dpp78272 2016-09-17 19:34
    关注

    In my experience with Go on Windows, the go build command will create an .exe~ shadow file because of:

    1. You previously build the runtime and created an .exe.
    2. You already started/executed the binary.
    3. That previous execution is still running or some other stupid file lock by windows has occurred.
    4. You attempt to go build again, while the previous binary was still in use.

    What happens under the hood is the go build will rename the existing executed .exe to .exe~ while it is in use, and will place the new binary at .exe for the next execution.

    I have always been fascinated by how it does that to files in use, when 20+ years of all other Windows apps returns the dreaded "File In Use" error.

    My best guess is that when you execute a go binary, the execution does not place a file lock on the file. So the next build can simply rename the in use one.

    During my tests (2014) that new .exe was the latest version and the .exe~ was the previous version that was running.

    I did a lot of testing around this as my use case purposely replaced the existing binary upon recompiling.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 spss统计中二分类变量和有序变量的相关性分析可以用kendall相关分析吗?
  • ¥15 拟通过pc下指令到安卓系统,如果追求响应速度,尽可能无延迟,是不是用安卓模拟器会优于实体的安卓手机?如果是,可以快多少毫秒?
  • ¥20 神经网络Sequential name=sequential, built=False
  • ¥16 Qphython 用xlrd读取excel报错
  • ¥15 单片机学习顺序问题!!
  • ¥15 ikuai客户端多拨vpn,重启总是有个别重拨不上
  • ¥20 关于#anlogic#sdram#的问题,如何解决?(关键词-performance)
  • ¥15 相敏解调 matlab
  • ¥15 求lingo代码和思路
  • ¥15 公交车和无人机协同运输