Xojo.IO.FolderItem.Child

From Xojo Documentation

Method

Xojo.IO.FolderItem.Child(name As Text, resolveAlias As Boolean = True) As Xojo.IO.FolderItem

Supported for all project types and targets.

Returns a FolderItem with the specified name that represents a file or folder within the FolderItem.

Parameters

Value Description
name The name of the child file or folder.
resolveAlias Indicates if the FolderItem should resolve to its actual item, if the FolderItem is an alias or shortcut.

If the path points to an alias or shortcut, the FolderItem is resolved to the actual item being pointed to only if resolveAlias is True.

Exceptions

  • RuntimeException if the child cannot be constructed, which would only be the case if the FolderItem is not a folder, or the last last component of the path does not already exist.

Sample Code

Gets a specific file in the Documents folder:

Using Xojo.IO
Var docs As FolderItem
docs = SpecialFolder.Documents
Var docFile As FolderItem = docs.Child("MyFile.txt")