How to use reuse softlinks created on Mac in Windows 8

前端 未结 3 1695
被撕碎了的回忆
被撕碎了的回忆 2021-01-20 12:47

I have few softlinks, says 1000 images which i have created in MacBook Pro which i am using in my iOS Apps.

Now i am porting the same app in Windows 8 phone app, so

3条回答
  •  南方客
    南方客 (楼主)
    2021-01-20 13:34

    Your question is missing a couple of details so I'm going to have to make a guess about your situation. The problem is:

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

    Unless you did something tricky, like installing 3rd party file system drivers, then the only file system that both Windows and OS X can read/write to natively is FAT based. So I'm guessing your situation is:

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

    Assuming the above situation, the problem is that there are no symlinks in FAT32 because the file system doesn't support them. OS X is tricking you because it "just works". What is really happening is that OS X is creating an ASCII text file that contains the line "XSym" along with the name of the file it is "linking" to, plus some file system information. You can confirm this by opening your softlinks on your Windows system in notepad. Normally you would see binary code if you were opening an actual image in notepad, but instead you should see the text from these fake symlinks.

    So, what do you do? I see a couple of options:

    1. You could use a file system that supports soft links. This could mean using HFS+ (OS X file system) which would require you to install HFS+ drivers on your Windows system so that it can read/write to the file system. Or it could mean going in the other direction and using NTFS (Windows file system) which would require you to install NTFS drivers on your Mac. Note that most recent versions of OS X can read NTFS file systems, they just can't write to them.

    2. You could use the fake symlinks that OS X is creating. This would require writing a parser to interpret the links or finding a library that does this for you. I don't have a copy, but I believe the XSym format is covered in the "OS X Internals" book.

    3. You could rethink the approach to your problem so that it doesn't require you to use symlinks.

    If this didn't solve your problem, then please provide more details because I had to make some guesses about your situation.

    ==EDIT==

    Take a look at the subversion documentation on symbolic links here. The relevant quote from the doc is:

    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.

    Basically, it says something similar to what I mentioned earlier, which is that symlinks are not supported that well if at all on Windows systems. Subversion just creates text files with the contents of the link so you can choose to either figure out how to parse these text files yourself or try to find a library that will parse them for you.

提交回复
热议问题