How to open file that has moved?

The reason NOT to use AbsolutePath etc is because Mac users (unlike Windows users) expect an app to find the document even if it has been moved (for example from a RecentItems menu).

As FSRef is deprecated how does one deal with this now? Is there a replacement that can still open moved files?

Could FSRef still be used on HFS+ volumes and URLpath on APFS volumes?

@Markus Winter — Even with FSRefs, the proper way to keep track of a file was to get an alias record and resolve it whenever you need it.

Since 10.6, it has been replaced by “bookmark” accessible through CFURL or NSURL. See:

  • CFURLCreateBookmarkDataFromFile
  • CFURLCreateByResolvingBookmarkData

The CFBookmarkMBS module in our plugins may help.

Or an older alias as you can get with MacAliasMBS class.

Markus, just a detail, but it would make sense to move this thread to macOS…

[quote=421180:@Markus Winter]The reason NOT to use AbsolutePath etc is because Mac users (unlike Windows users) expect an app to find the document even if it has been moved (for example from a RecentItems menu).

As FSRef is deprecated how does one deal with this now? Is there a replacement that can still open moved files?

Could FSRef still be used on HFS+ volumes and URLpath on APFS volumes?[/quote]

Please see: http://documentation.xojo.com/api/files/folderitem.html.GetSaveInfo
No plugin required.

Thanks Jason and everyone!