c# - 如何在 Windows 8 中使用在 Mac 上创建的重用软链接(soft link)

标签 c# windows windows-8 windows-phone-8 symlink

我几乎没有软链接(soft link),说有 1000 张图像是我在 MacBook Pro 中创建的,我正在我的 iOS 应用程序中使用。

现在我在 Windows 8 手机应用程序中移植相同的应用程序,所以我想在 Windows 手机 8 应用程序中重用相同的软链接(soft link),那么我该如何使用它呢?

我曾尝试在 Windows 8 机器上打开软链接(soft link),但它显示“不支持文件格式”。

我的 Windows 机器上有原始文件和软链接(soft link)。

有没有其他方法可以重复使用相同的软链接(soft link)?如果不是,我可以遵循的最佳方法是什么。

编辑

好的,这是关于此的更多信息:

在 MacBook Pro 中

我在桌面上有一个文件夹,它有物理路径(实际图像),现在我已经使用脚本创建了软链接(soft link),这些软链接(soft link)被放置在一些不同的文件夹中。

现在我在我的 iOS 应用程序中使用这些软链接(soft link)。

在 Windows 8 中

我已经从 Mac 复制了具有 soflink 的文件夹以及其中包含实际文件的文件夹。

现在我已经在我的桌面上粘贴了实际的文件文件夹,在一些 D: 驱动器中粘贴了 soflinks 文件夹,现在如果我将我的 soflink 文件夹放在 D 驱动器中,当我检查这些图像时它显示空白,因为它没有指向实际文件。

我有实际的文件夹和 soflink 文件夹。

还有一点是,当您创建软链接(soft link)时,在 MacBook Pro 中它会显示此图标:enter image description here

但在 Windows 8 上它是空白的。

最佳答案

您的问题缺少一些细节,因此我将不得不猜测您的情况。问题是:

You created some symlinks using OS X on a file system and now you are having problems accessing those symlinks in Windows.

除非你做了一些棘手的事情,比如安装第 3 方文件系统驱动程序,否则 Windows 和 OS X 都可以本地读取/写入的唯一文件系统是基于 FAT 的。所以我猜你的情况是:

You created some symlinks using OS X on a FAT32 file system and now you are having problems accessing those symlinks in Windows.

假设上述情况,问题是 FAT32 中没有符号链接(symbolic link),因为文件系统不支持它们。 OS X 是在欺骗你,因为它“能正常工作”。真正发生的是 OS X 正在创建一个 ASCII 文本文件,其中包含“XSym”行以及它“链接”到的文件的名称,以及一些文件系统信息。您可以通过在记事本中打开 Windows 系统上的软链接(soft link)来确认这一点。通常,如果您在记事本中打开实际图像,您会看到二进制代码,但您应该看到这些虚假符号链接(symbolic link)中的文本。

那么,你是做什么的?我看到几个选项:

  1. 您可以使用支持软链接(soft link)的文件系统。这可能意味着使用 HFS+(OS X 文件系统),这将要求您在 Windows 系统上安装 HFS+ 驱动程序,以便它可以读取/写入文件系统。或者它可能意味着朝另一​​个方向前进并使用 NTFS(Windows 文件系统),这将要求您在 Mac 上安装 NTFS 驱动程序。请注意,最新版本的 OS X 可以读取 NTFS 文件系统,但无法写入。

  2. 您可以使用 OS X 正在创建的虚假符号链接(symbolic link)。这将需要编写一个解析器来解释链接或找到一个为您执行此操作的库。我没有副本,但我相信 XSym 格式包含在“OS X 内部结构”一书中。

  3. 您可以重新考虑解决问题的方法,这样它就不需要您使用符号链接(symbolic link)。

如果这不能解决您的问题,那么请提供更多详细信息,因为我不得不对您的情况做出一些猜测。

==编辑==

查看有关符号链接(symbolic link)的颠覆文档 here . 该文档的相关引用是:

Versioning Symbolic Links

On non-Windows platforms, Subversion is able to version files of the special type symbolic link (or “symlink”). A symlink is a file that acts as a sort of transparent reference to some other object in the filesystem, allowing programs to read and write to those objects indirectly by way of performing operations on the symlink itself.

When a symlink is committed into a Subversion repository, Subversion remembers that the file was in fact a symlink, as well as the object to which the symlink “points.” When that symlink is checked out to another working copy on a non-Windows system, Subversion reconstructs a real filesystem-level symbolic link from the versioned symlink. But that doesn't in any way limit the usability of working copies on systems such as Windows that do not support symlinks. On such systems, Subversion simply creates a regular text file whose contents are the path to which to the original symlink pointed. While that file can't be used as a symlink on a Windows system, it also won't prevent Windows users from performing their other Subversion-related activities.

基本上,它说的内容与我之前提到的类似,即符号链接(symbolic link)在 Windows 系统上即使有也得不到很好的支持。 Subversion 只是用链接的内容创建文本文件,因此您可以选择自己弄清楚如何解析这些文本文件,或者尝试找到一个可以为您解析它们的库。

关于c# - 如何在 Windows 8 中使用在 Mac 上创建的重用软链接(soft link),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21403772/

相关文章:

c# - 在 Controller 操作中进行异步调用

c# - 在 Metro 风格应用程序中模拟按钮单击

c# - SQLite-net 中的名称表

python - 带有 python 2.7 的 Windows 上的 Readline 功能

c# - Windows 8 应用程序的 ViewModel 中的依赖属性与 INotifyPropertyChanged

c# - 将列表的成员移动到列表的前面

c# - 取消异步操作

c# - 如何在 Mac OS 中注册服务?

windows - Windows 上的 Git : How do you set up a mergetool?

linux - 部署工具后Matlab UI程序运行不正常