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.

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

报告相同问题?

悬赏问题

  • ¥30 STM32 INMP441无法读取数据
  • ¥100 求汇川机器人IRCB300控制器和示教器同版本升级固件文件升级包
  • ¥15 用visualstudio2022创建vue项目后无法启动
  • ¥15 x趋于0时tanx-sinx极限可以拆开算吗
  • ¥500 把面具戴到人脸上,请大家贡献智慧
  • ¥15 任意一个散点图自己下载其js脚本文件并做成独立的案例页面,不要作在线的,要离线状态。
  • ¥15 各位 帮我看看如何写代码,打出来的图形要和如下图呈现的一样,急
  • ¥30 c#打开word开启修订并实时显示批注
  • ¥15 如何解决ldsc的这条报错/index error
  • ¥15 VS2022+WDK驱动开发环境