移动后找到文件 [英] Locate file after move

查看:94
本文介绍了移动后找到文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在通过文件系统事件观察文件路径以进行更改。现在我需要知道是否可以获得对位置无关的文件的引用,以便在移动文件时跟踪文件。

I'm observing a file path for changes via file system events. Now I need to know if it is possible to get a reference to a file that is location independent, to keep track of the file when it is moved.

这是使用OSX API完成?

Is this be accomplished with OSX APIs?

推荐答案

您可以通过获取文件的别名引用来实现。这需要使用Carbon API,但有一个很好的Objective-C包装器叫做NDAlias,我过去使用过: https: //github.com/nathanday/ndalias

You can do this by getting an alias reference to the file. This requires using Carbon API, but there's a nice Objective-C wrapper called NDAlias that I've used in the past: https://github.com/nathanday/ndalias .

请参阅这里获取更多文档: https://developer.apple.com/library/mac/#documentation/Carbon/Reference/Alias_Manager/Reference/ reference.html

See here for more documentation: https://developer.apple.com/library/mac/#documentation/Carbon/Reference/Alias_Manager/Reference/reference.html

这篇关于移动后找到文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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