NSFileSystemFileNumber changes after changing or updating a file in object c

I am working on a file management system like Dropbox in Cocoa.

My problem is when I edit any text file at this time NSFileSystemFileNumber .

I want a unique NSFileSystemFileNumber , even if this edited file is moved from a specific folder.

In short, I just want to learn how to extract this migrated file from the old or source path from the database.

Any alternative way to solve this problem?

Thanks in Adv .. !!

0
source share
1 answer

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

  • Delete existing file.
  • Create a new file.
  • Writing file data.

Therefore, you get a new index every time. Others may:

  • Trim an existing file.
  • Writing file data.

which will lead to the same inode every time.

You can't do anything about this, so you will need to track file changes using a name or something, not an inode.

+1
source

Source: https://habr.com/ru/post/1667094/


All Articles