FolderItem.SaveInfo

From Xojo Documentation

Method

FolderItem.SaveInfo(relativeTo As FolderItem, saveInfoMode As FolderItem.SaveInfoModes = FolderItem.SaveInfoModes.Default) As String

New in 2019r2

Supported for all project types and targets.

Allows saving FolderItem references without relying on the absolute path.

Notes

The returned String is binary data that indicates a path which is relative to the supplied RelativeTo folder. You may pass Nil to indicate that you do not care for a relative resolution of the path (this is, for instance, still useful on macOS where renamed and moved files can still be found with the FolderItem.FromSaveInfo function nonetheless).

fa-info-circle-32.png
The returned String is not intended to be human-readable and any modifications may render it useless.

Example

Gets the SaveInfo for a file. Typically you save this somewhere (perhaps a preference file) so the file can be recreated later using FolderItem.FromSaveInfo.

Var myFile As FolderItem = SpecialFolder.Documents.Child("MyFile.txt")
Var saveInfo As String = myFile.SaveInfo(SpecialFolder.Documents)

See Also

FolderItem.FromSaveInfo