Search code examples
iosunixios5aliasnsfilemanager

How to create a file alias in iOS?


In order to support UIDocumentController options on different file types, I thought that perhaps creating and pointing to a file alias would be a good solution. The file is large, so copying the file and duplicating it would create some overhead. Is there a way to point to the original file, but under a different name/extension, like a Finder alias?


Solution

  • You can do this using hard links.

    To create them, take a look at linkItemAtURL:toURL:error: and linkItemAtPath:toPath:error: in NSFileManager.