【问题标题】:Is there any way to open a folder containing long filename in MS Windows perl? [closed]有没有办法在 MS Windows perl 中打开包含长文件名的文件夹? [关闭]
【发布时间】:2021-04-12 20:53:16
【问题描述】:

Perl 脚本打开包含长文件名的文件夹并显示错误“Could not open 'dir' for reading 'Filename too long'”

【问题讨论】:

  • 文件名不应短,只有与需要打开的文件名相同。这点忘记加了所以在cmets里加了
  • 你能告诉我们你尝试了什么吗?您可以编辑问题并粘贴代码。请参阅minimal-reproducible-example 了解更多信息。
  • 使用chdir()切换到子目录,这样你想要的文件的路径就不会那么长了。
  • 你能说出你使用的操作系统吗? codeproject.com/Questions/1002424/… 建议它是通过使用 Win32::LongPath 修复的 MX Windows 特定问题
  • 这个问题值得了解 Windows 文件系统及其 API 的人给出很好的回答。这并不容易,而且有点超出我的想象。

标签: windows perl


【解决方案1】:

perl:在 MS Windows 中处理长文件名

https://www.codeproject.com/Questions/1002424/how-to-resolve-Filename-too-long-when-readdir-in-p 建议这是通过使用Win32::LongPath perl 模块修复的 MS Windows 特定问题。

【讨论】:

  • 感谢所有回答我的问题的人,我使用了 Win32::LongPath,它工作正常。
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2022-01-06
  • 2010-11-05
  • 2019-01-30
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多