移动后找到文件

编程入门 行业动态 更新时间:2024-10-27 15:20:21
本文介绍了移动后找到文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

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

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/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: github/nathanday/ndalias .

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

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

更多推荐

移动后找到文件

本文发布于:2023-08-01 20:11:31,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1271335.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:文件

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!