如何以编程方式使系统创建交换文件?
如果您必须以编程方式让系统为您创建交换文件,您会怎么做?
我并不打算实际创建交换文件,而是正在调试自己的代码中的一个问题,试图更好地理解我做错了什么,导致系统创建交换文件。
我的程序(毫无疑问你已经猜到了)正在对文件进行大量读取和写入(从文件 A 中提取一些数据并将其写入文件 B)
什么会导致发生这样的事情?
更新:
- 请注意创建的交换文件大小为 0 字节。
- 程序用Java编写并在Linux上运行
If you had to programmatically have system create swap files for you, how would you do it?
I am not looking to actually create swap file, but am debugging an issue in own code trying to better understand what did i do wrong that would cause system to create the swap files.
My program (as no doubt you have guessed) is doing a lot of reading and writing of files (extract some data from file A and write it to file B)
What would cause something like this to happen?
UPDATE:
- Please note swap files created are 0 bytes in size.
- Program is written in Java and runs on Linux
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

发布评论
评论(3)
~没有更多了~
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
Vim 或 Gvim 创建 .swp 文件。也许您有一个调用 Vim 的脚本?我从未在脚本中调用过 vim,但是 这是一个关于这样做的问题,所以我很确定这是可能的。
Vim or Gvim creates .swp files. Maybe you have a script that invokes Vim? I've never invoked vim in a script, but this is a question about doing that, so I'm pretty sure it's possible.