What is FromSaveInfo for?

What is the purpose of the new method FolderItem.FromSaveInfo?

It doesn’t show up when I do a search on the forum.
I also cannot figure out the comparable as in deprecated method.

@Arthur Gabhart — Because of the syntax, I think it would re-create a FolderItem object from SaveInfo obtained with FolderItem.GetSaveInfo. As such, it probably takes an optional argument “relativeTo as FolderItem” (necessary if the SaveInfo was created relative to a FolderItem).

Note that GetSaveInfo uses an instance of FolderItem whereas FromSaveInfo uses the FolderItem class.

Thank you. That helps with usage. It does use SaveInfo in just that way.

From the LR

f = New FolderItem g = f.FromSaveInfo(f.SaveInfo(FolderItem.DriveAt(0).Child("Documents"), 0))

To me this is duplicating a file.
A deeper question then is what besides duplicating a file can it be used for?

Still asking. Is there a deprecated method?

@Arthur Gabhart — SaveInfo (the modern version of a Mac Alias) helps you keeping track of a file even if it has been renamed or moved. If you need to store a reference to a file for future use, instead of storing the path you can store its SaveInfo so you can retrieve the file even if the end-user decided to rename a folder in the path, moved it or renamed it.

Thanks but what about FromSaveInfo?

@Arthur Gabhart — Well “GetSaveInfo” will create the data to later retrieve a file (data that your can store easily in a file) and “FromSaveInfo” will use those data to actually retrieve the file.

Complement to the above:
the file will be found even if it is not at the same location it was when the save process ran:
https://documentation.xojo.com/api/files/folderitem.html.SaveInfo

If you have troubles trying to implement that: I too had, the documentation and my mind were not in tune…

[quote=485921:@Emile Schwarz]Complement to the above:
the file will be found even if it is not at the same location it was when the save process ran: [/quote]

Thanks Emile. I agree with your interpretation. I can’t imagine when that would be a problem. Unless it go moved to a different folder, like a Mac does.

Users do all kinds of things on our back, it is incredible the inventivity they can have to broke things :wink:

Agreed. They can be worse than computer programmers. Giggle