如何临时更改 Perl 使用的 tmp 目录?

发布于 2024-10-07 00:44:10 字数 189 浏览 0 评论 0原文

我使用的一些库似乎向 /tmp 写入内容。

我想将我的脚本(以及所有导入的库)使用的“临时”目录位置更改为 /new/tmp/location。不用说,我不想影响我的脚本之外的任何内容(因此例如重新安装 /tmp 不是一个选项)。

我怎样才能做到这一点?

Some libraries I use seem to write stuff to /tmp.

I would like to change the 'temporary' directory location my script (and all the imported libraries) uses to /new/tmp/location. Needless to say, I don't want to effect anything outside my script (so e.g remounting /tmp is not an option).

How can I do that?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

挽梦忆笙歌 2024-10-14 00:44:10

许多库将在 TMPDIR 环境变量(如果已设置)指定的目录中创建临时文件。尝试一下;如果这没有帮助,您将不得不更多地说明您想要影响哪些库。

Many libraries will create temporary files in the directory specified by the TMPDIR environment variable, if it is set. Give it a try; if that doesn't help, you're going to have to say more about what libraries you are wanting to affect.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文