在目标c中编辑/更新文件后,NSFileSystemFileNumber发生更改 [英] NSFileSystemFileNumber is changed after file is edited/updated in objective c

查看:119
本文介绍了在目标c中编辑/更新文件后,NSFileSystemFileNumber发生更改的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用文件管理系统,就像 Cocoa 中的 Dropbox 一样。

I am working on File Management System exactly like Dropbox in Cocoa.

我的问题是,当我编辑当时的任何文本文件 NSFileSystemFileNumber 被更改时。

My problem is when i edit any text file at that time NSFileSystemFileNumber is changed.

我想要一个唯一的 NSFileSystemFileNumber ,即使该编辑文件已从特定文件夹中移出。

I want an unique NSFileSystemFileNumber even if that edited file is moved from the particular folder.

简而言之,我只想知道如何从数据库中获取该移动文件的旧路径或原始路径。

In short, I just want to know how to fetch that moved file's old or original path from the database.

还有其他解决此问题的方法吗?

Any alternate way to solve out this problem?

感谢Adv .. !!

Thanks in Adv..!!

推荐答案

这取决于如何实现编辑器保存功能。每个编辑器将具有不同的功能,听起来您正在使用的编辑器将执行以下操作:

It depends on how the editor save functionality is implemented. Each editor will have different functionality and it sounds like the one you are using does the following:


  1. 删除现有文件。

  2. 创建新文件。

  3. 写文件数据。

因此每次获取一个新的索引节点。其他人可能会:

Hence you get a new inode each time. Others might:


  1. 截断现有文件。

  2. 写入文件数据。

每次都会导致相同的索引节点。

which would result in the same inode each time.

您将需要使用名称或其他名称而不是inode来跟踪文件更改。

There is nothing you can about this so you will need to track file changes using the name or something, not the inode.

这篇关于在目标c中编辑/更新文件后,NSFileSystemFileNumber发生更改的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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