Category: File function (found in the "Special" category in the EasyMorph application)
This function extracts the directory path from a full file path, excluding the file name.
Argument | Type | Description |
---|---|---|
full_path | Text | A full file path including the directory path and file name. |
Return value type: Text.
Return values containing only a root path will include the trailing backslash while non-root paths will not include the trailing backslash. See the "Examples" section below.
When a relative reference is used in a rooted path, only the dot or double-dot is returned without the trailing backslash. See the "Examples" section below.
directory('C:\myproject.morph') //Returns 'C:\' (Root paths include a backslash.)
directory('C:\Documents\myproject.morph') //Returns 'C:\Documents' (No trailing backslash for non-root paths.)
directory('..\myproject.morph') //Returns '..' (Rooted relative reference excludes the backslash.)
directory('..\MyProjects\March\myproject.morph') //Returns '..\MyProjects\March' (Relative reference)