Method
FolderItem.GetSaveInfo
Warning
This item was deprecated in version 2019r2. Please use FolderItem.SaveInfo as a replacement.
Description
Allows saving FolderItem references without relying on the absolute path.
Notes
The returned string 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).
The Class Constants and values for Mode are:
Class Constant |
Value |
Description |
---|---|---|
SaveInfoDefaultMode |
0 |
The FolderItem should be open in any way that it can possibly be created. This is the default value. |
SaveInfoRelativeMode |
1 |
The FolderItem should only be opened using relative path information. |
SaveInfoAbsoluteMode |
2 |
The FolderItem should only be opened using absolute path information. |
Note
The returned string is not intended to be human-readable and any modifications may render it useless.
Sample code
Shows how a GetSaveInfo string can be used with GetRelative to open a file and show its path:
Dim f, g As FolderItem
f = New FolderItem
g = f.GetRelative(f.GetSaveInfo(Volume(0).Child("Documents"), FolderItem.SaveInfoDefaultMode))
If g <> Nil Then
TextField1.Text = g.NativePath
Else
MsgBox("FolderItem does not exist!")
End If
You can also use GetFolderItem to open a GetSaveInfo string:
Dim saveInfo As String ' Assign a saveInfo string from a previously accessed file
Dim f As FolderItem
f = GetFolderItem(saveInfo, FolderItem.PathTypeNative)
Compatibility
All project types on all supported operating systems.
See also
FolderItem parent class