【问题标题】:Why do I get an error when I pass a symbolic link to Gnuplot under Cygwin?为什么我在 Cygwin 下将符号链接传递给 Gnuplot 时会出错?
【发布时间】:2014-06-05 12:46:17
【问题描述】:

gnuplot 中使用符号链接时出现错误:

on l: drive

plot "/j/projMainpips/Aggregate/dailyStats.txt" u 1:4 w l lw 1

warning: Skipping unreadable file "/j/projMainpips/Aggregate/dailyStats.txt"
No data in plot

链接创建为:

ln -s //xxx.yy.xx.y/Users/spence/JobsStuff/ /j

如果我不使用链接,它可以正常工作:

on h: in folder /j

plot "projMainpips/Aggregate/dailyStats.txt" u 1:4 w l lw 1

如何在gnuplot 中启用符号链接?

【问题讨论】:

    标签: windows cygwin gnuplot symlink ln


    【解决方案1】:

    我已经在 Cygwin 32 下测试了指向 UNC 路径的符号链接,它在这里工作。

    您使用的是gnuplot 的 Cygwin 版本吗?如果您尝试改用native Win32 port of gnuplot,则会收到此类错误。

    如果您可以在 Cygwin 文本编辑器中打开文件,则表明符号链接有效:

    vi /j/projMainpips/Aggregate/dailyStats.txt
    

    这里遇到麻烦的另一种方法是编辑/etc/fstab 以删除cygdrive 前缀。如果您这样做,您的语法将尝试查找J: 系统驱动器。您需要使用多个字母来避免此问题或将 fstab 恢复为原始形式。

    【讨论】:

    • 是的 - 我正在使用 gnuplot 的本机 win32 端口
    • @ManInMoon:那是你的问题。 Cygwin 在 Windows 上模拟了许多 POSIX 机制——包括符号链接和POSIX paths——但你必须在 Cygwin 下构建一个程序才能获得这些好处。 Cygwin 并没有——实际上不能——将这些好处赋予不是在 Cygwin 下构建的程序。解决方法是使用Gnuplot的Cygwin端口,可以通过Cygwin的setup.exe下载。
    【解决方案2】:

    当您从 Cygwin 执行本机 Windows 应用程序时,您应该使用cygpath将路径从 Unix 转换为 Windows 格式。您也可以使用符号链接尝试它,也许它会起作用并将符号链接的目标路径转换为 ​​Windows 版本路径。我没有尝试过,所以我不确定它是否有效,但值得尝试。

    使用示例:

    # convert specified Cygwin path to the Windows path
    cygpath -w ~
    
    notepad `cygpath -w ~/test.txt`
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2012-01-03
      • 2020-12-23
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多