【问题标题】:Virtual File Name too long虚拟文件名太长
【发布时间】:2015-09-30 19:41:22
【问题描述】:

我在 bash 上使用 <() 创建虚拟文件。我基本上是将字符串转储到其中,所以我会得到<(contents of string),但是,字符串太长了,我得到了这个错误

:error:0200103F:system library:fopen:File name too long:bss_file.c:391.

关于创建虚拟文件时如何防止这种情况的任何建议?

【问题讨论】:

  • 显示您的代码。我敢打赌你使用的进程替换是错误的。
  • 哦,我正在以编程方式进行,图书馆正在做一些卫生工作,否则它实际上应该可以工作。
  • “它应该可以工作”,但事实并非如此。显示您的代码。
  • 语法不是<(contents of string)。这是<(command that produces string)

标签: bash file virtual


【解决方案1】:

你可能正在写类似的东西

my_command <(foo bar baz)

什么时候该写

my_command <(printf "%s\n" foo bar base)

进程替换运行一个命令,其输出被视为文件的内容;它不只是将内容作为字符串序列提供。

【讨论】:

    猜你喜欢
    • 2021-08-14
    • 2014-05-30
    • 2015-04-18
    • 2016-12-28
    • 1970-01-01
    • 2015-07-05
    • 2020-04-08
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多