从windows访问cygwin符号链接 [英] Accessing a cygwin symlink from windows

查看:213
本文介绍了从windows访问cygwin符号链接的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是cygwin的新手。我创建了一个符号链接如下

I am quite new to cygwin. I created a symlink as follows

$ ln -s /var/www /cygdrive/d/foo

,当我检查 D 通过窗口,我看到一个名为 foo 的系统文件。有没有办法让 foo 作为Windows的文件夹而不是系统文件?

and when I check the D drive via windows, I see a system file called foo. Is there a way to make foo act as a folder for Windows instead of a system file?

推荐答案

不是我知道的。 Cygwin不会更新操作系统有符号链接,相反,它允许你'伪造'符号链接从Cygwin shell。你可以设置shell使用Windows LNK文件,这可以做你想要的,但...

Not that I know of. Cygwin doesn't update the OS to have symlinks, rather, it allows you to 'fake' symlinks from within the Cygwin shell. You can set up the shell to use Windows LNK files, which may do what you want, but ...

Cygwin文档


使用cygutils创建快捷方式

Creating shortcuts with cygutils

另一个问题区域在
之间Unix风格的链接,将一个文件
链接到另一个,和Microsoft .lnk文件,
,它们提供了文件的快捷方式。
他们似乎相似,乍一看,但
在现实中,是相当不同。默认情况下,Cygwin不会创建
符号链接作为.lnk文件,但是有一个
选项来实现,请参见
节CYGWIN环境
变量。这些符号链接.lnk文件
与Windows创建的
.lnk文件兼容,但它们仍然是
不同。它们不包括
中许多信息,这些信息在
标准Microsoft快捷方式中可用,例如
工作目录,图标等。
cygutils包包含
mkshortcut实用程序用于创建
标准本机Microsoft .lnk文件。

Another problem area is between Unix-style links, which link one file to another, and Microsoft .lnk files, which provide a shortcut to a file. They seem similar at first glance but, in reality, are fairly different. By default, Cygwin does not create symlinks as .lnk files, but there's an option to do that, see the section called "The CYGWIN environment variable". These symlink .lnk files are compatible with Windows-created .lnk files, but they are still different. They do not include much of the information that is available in a standard Microsoft shortcut, such as the working directory, an icon, etc. The cygutils package includes a mkshortcut utility for creating standard native Microsoft .lnk files.

但这里的问题。如果Cygwin
处理这些本地快捷方式像
任何其他符号链接,你不能
将Microsoft .lnk文件存档到tar
存档并保留所有信息
。在解包之后,这些
快捷方式将丢失所有的
额外的信息,并且将不是
不同于标准的Cygwin
符号链接。因此,这两种类型的
链接被不同地对待。
不幸的是,这意味着
通常的Unix方式创建和使用
符号链接不能与本机
Windows快捷方式一起使用。

But here's the problem. If Cygwin handled these native shortcuts like any other symlink, you could not archive Microsoft .lnk files into tar archives and keep all the information in them. After unpacking, these shortcuts would have lost all the extra information and would be no different than standard Cygwin symlinks. Therefore these two types of links are treated differently. Unfortunately, this means that the usual Unix way of creating and using symlinks does not work with native Windows shortcuts.

这篇关于从windows访问cygwin符号链接的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆