gpt4 book ai didi

macos - macOS 上的 mktemp 随机文件生成失败 : file exists

转载 作者:行者123 更新时间:2023-12-05 03:01:00 24 4
gpt4 key购买 nike

当我在 macOS 上使用 mktemp 创建一个随机文件时,我得到:

mktemp /tmp/test.XXXXXXX.json
mktemp: mkstemp failed on /tmp/test.XXXXXXX.json: File exists

它不会用随机字符串替换XXXXXXX。在 Linux 上运行良好,但在 macOS 上运行不佳。

最佳答案

事实证明,无论出于何种原因,macOS 版本的 mktemp 支持 only trailing XXXXXX 随机字符串,换句话说 mktemp/tmp/test.XXXX 可以,但不能 /tmp/test.XXXX.json

关于macos - macOS 上的 mktemp 随机文件生成失败 : file exists,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/56320445/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com