Available since Version 1.8.
Returns the parent path of the specified file path.
This will return the file name if it is only given a file name.
Syntax
GetPathParent( path, [windows] )Arguments
- path (string): The file path that you want to get the parent path out of.
- windows (boolean): Whether to parse the path using backslashes.
- Optional, defaults to true.
Return Values
- (string): The parent path.
Examples
-- Returns "scripts\missions\level01"
GetPathParent("scripts\\missions\\level01\\level.mfk")
-- Returns "level.mfk"
GetPathParent("level.mfk")