问题描述
我有一个文件夹,并且已经在我的MAC OS桌面上创建了一个别名(快捷方式).现在,当我将该别名从MAC OS复制到Windows时,它将显示一种文件类型为文件".
I have one Folder and I have created an Alias (Short-cut) on my MAC OS Desktop. Now, when I copy that Alias from MAC OS to Windows, then it shows me a type of file as "File".
现在,如果我再次将该别名从Windows复制到Mac OS,则该别名现在为 Unix可执行文件文件,而不是别名.
Now if I again copy that Alias from Windows to Mac OS, then that alias is now Unix Executable file and Not an Alias.
我尝试压缩该Alias,但仍然遇到相同的问题.是否可以在Windows上保留MAC Alias,并且当我将该Alias复制回Mac时,它仍然是Alias.
I have tried zipping that Alias, and still having the same issue. Is it possible to persist MAC Alias on Windows and when i copy that Alias back to Mac then it remains Alias.
推荐答案
Mac文件系统可以将几种元数据附加到其他文件系统不支持的文件中,例如Windows使用的文件.根据文件在系统之间的确切移动方式,此元数据可能会保留,也可能不会保留.如果丢失,该文件可能变得无法使用.
Mac filesystems can attach a several kinds of metadata to files that are not supported by other filesystems, such as those Windows uses. Depending on exactly how the file is moved between systems, this metadata may or may not be preserved; if it gets lost, the file may become unusable.
对于别名文件,有两个相关的元数据片段:类型代码(将文件标识为别名)和资源派生(对于别名文件,用于存储要存储在何处的信息)找到原始项目).实际上,由旧版OS X创建的别名文件根本没有常规内容(数据叉")-如果丢失了它们的元数据,则将留下未知类型的空文件.较新的版本将原始项目信息存储在资源和数据分支中,因此,如果资源分支丢失了,它仍然可以使用.但是如果类型代码丢失,则操作系统不知道它是别名,它只会看到一些无法识别的数据(它误认为是unix可执行文件).
In the case of alias files, there are two relevant pieces of metadata: the type code (which identifies the file as an alias), and the resource fork (which in the case of alias files, stores the info about where to find the original item). Alias files created by older versions of OS X actually had no regular contents (the "data fork") at all -- if their metadata got lost, you were left with an empty file of unknown type. More recent versions store the original item info in both the resource and data forks, so if the resource fork gets lost it's still usable; but if the type code is lost, the OS has no idea it's an alias, it just sees some unidentifiable data (which it mistakes for a unix executable).
在某些情况下,如果使用正确的OS X工具将文件复制/移动到外部文件系统(不支持类型代码,资源派生等),则OS X工具将对&以其他替代形式存储元数据:
In some cases, if you use the right OS X tools to copy/move files to foreign filesystems (that don't support type codes, resource forks, etc), the OS X tool will encode & store the metadata in some alternate form:
-
如果使用Finder将文件复制到FAT32闪存驱动器,它将使用 AppleDouble 格式.如果您在Windows上查看此内容,则会看到例如别名文件"和"._alias文件".只要将这两个文件放在一起,当它们回到Mac上时,它将在逻辑上将它们重新组合成具有其所有元数据的单个文件.
If you use the Finder to copy a file to a FAT32 flash drive, it'll store the metadata as a separate file with a "._" prefix on the name, using AppleDouble format. If you look at this on Windows, you'll see e.g. "alias file" and "._alias file". As long as the two files are kept together, when they get back to a Mac, it'll logically reassemble them into a single file with all its metadata.
如果使用Finder创建zip归档文件,它将做一个非常相似的技巧,将元数据作为"._"文件存储在zip归档文件中(位于__MACOSX子文件夹中);然后,如果您使用Finder(实际上是存档实用程序")扩展存档,它将重新组合文件.
If you use the Finder to create a zip archive, it'll do a very similar trick where it stores the metadata as "._" files inside the zip archive (in a __MACOSX subfolder); and if you expand the archive with the Finder (actually Archive Utility), it'll reassemble the files.
但是OS X的命令行zip工具不支持此AppleDouble/."技巧.如果您使用 zip
创建存档,则它将仅保留Mac专用的元数据,并且如果对包含.的存档使用 unzip
."文件,它将不会重新组合它们.如果您需要在命令行上创建zip存档,请实际上是解决之道.
But OS X's command-line zip tools do not support this AppleDouble/"." trick. If you use zip
to create an archive, it will simply leave off the Mac-only metadata, and if you use unzip
on an archive that contains "." files, it will not reassemble them. If you need to create zip archives at the command line, ditto
is actually the way to go.
如果使用Finder将文件复制到使用NTFS文件系统的Windows服务器,它将把元数据隐藏在备用数据流(高级元数据的仅Windows形式)附加到文件,并且如果您使用Finder将其复制回,重新正确组装.但是,如果您使用其他东西,或者以不保留备用数据流的方式移动/复制文件,则它将丢失.
If you use the Finder to copy the files to a Windows server that uses the NTFS filesystem, it'll hide the metadata in an alternate data stream (a Windows-only form of advanced metadata) attached to the file, and if you use the Finder to copy it back it'll be reassembled properly. But if you use something else, or move/copy the file in a way that doesn't preserve the alternate data stream, it'll get lost.
这篇关于MAC OS X别名文件夹/文件在Windows上不持久的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!