简体   繁体   English

为什么 Pycharm 生成 .bak 文件

[英]Why is Pycharm generating .bak files

My Pycharm started to generate .bak files, for example views.py.bak for file views.py These files are backup files, so I'm guessing that there should be some option to disable/activate bak files.我的 Pycharm 开始生成 .bak 文件,例如文件 views.py 的 views.py.bak 这些文件是备份文件,所以我猜应该有一些选项可以禁用/激活 bak 文件。 Solution?解决方案?

Third-party modules will create the .bak files.第三方模块将创建 .bak 文件。 Example - WinMerge : winmerge documentation示例 - WinMerge: winmerge 文档
Also, developers used to keep the backup copy naming like this ".bak , .old , .new and so on."此外,开发人员过去常常将备份副本命名为“.bak、.old、.new 等”。
Wiki link : Bak File维基链接: Bak 文件


(As per the win Merge Documentation guide below) (根据下面的 win 合并文档指南)
Backup Files page备份文件页面
This page allows you to control how WinMerge creates backup files.此页面允许您控制 WinMerge 创建备份文件的方式。

  1. Create backup files in Specify when WinMerge should create backup files.在指定 WinMerge 应何时创建备份文件中创建备份文件。 You can enable or disable each of these options independently:您可以独立启用或禁用这些选项中的每一个:

Folder compare (disabled by default): Backup files are create whenever files are overwritten (copied).文件夹比较(默认禁用):只要文件被覆盖(复制),就会创建备份文件。

File compare (enabled by default): Backup files are created whenever files are saved.文件比较(默认启用):每次保存文件时都会创建备份文件。

  1. Create backup files into Specify where backup files are created.创建备份文件到 指定创建备份文件的位置。 Only one of these options can be enabled:只能启用以下选项之一:

Original file's folder (enabled by default): Backup files are created in the same folder as the source file.原始文件的文件夹(默认启用):备份文件与源文件在同一文件夹中创建。 This is usually a good choice.这通常是一个不错的选择。 The down side is that cleaning up backup files in big folders can take a lot of work.不利的一面是清理大文件夹中的备份文件可能需要大量工作。

Global backup folder (disabled by default): All backup files are created in one global folder.全局备份文件夹(默认禁用):所有备份文件都创建在一个全局文件夹中。 This makes them easy to clean up.这使它们易于清理。 But, if there are multiple source files with same file name, then the most recent backup file overwrites the previous one of the same name.但是,如果有多个具有相同文件名的源文件,则最近的备份文件会覆盖前一个同名的文件。

  1. Backup filename When WinMerge creates a backup file, it appends an extension to the source file name.备份文件名 当 WinMerge 创建备份文件时,它会在源文件名后附加一个扩展名。 You can choose either or both of these extension schemes:您可以选择以下两种扩展方案中的一种或两种:

Append .bak -extension (enabled by default): For example, the file.txt is backed up to file.txt.bak. Append .bak -extension(默认开启):比如file.txt备份到file.txt.bak。

File compare (enabled by default): Timestamps are almost always unique, so this option usually avoids duplicating backup file names when the source files have the same names.文件比较(默认启用):时间戳几乎总是唯一的,因此当源文件具有相同的名称时,此选项通常可以避免重复备份文件名。

Also, storing a copy of a file each time you save it provides a way to track changes to the file.此外,每次保存文件时都会存储一份文件副本,这提供了一种跟踪文件更改的方法。 However, you should consider that this option can create a lot of files.但是,您应该考虑到此选项会创建大量文件。


声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM