I am able to get the inode / system file number from a path in Swift like so:
try(print(FileManager.default.attributesOfItem(atPath:myFilePath)[.systemFileNumber]!))
However, I am not sure how I can do the opposite - retrieve the file path from the inode number. On the command line there is the magic .vol
directory as discussed here, but that would be fiddly/inefficient to use programmatically.
I do not need to open the file, just get the path in the most efficient way possible. Essentially, I need to store a list of a 50-500k files, and storing their full paths is very inefficient memory wise and I don't usually need to refer back to them, so I want to store just their inode values to then look them up if needed.