filename_path(fname)

From ENIGMA
Jump to navigation Jump to search

Description

Gets the path part of the given file name, which is the same as getting the directory except this function includes the final backslash, and returns it.

Parameters

Parameter Data Type Description
fname string file name and path

Return Values

string: Returns the path part of the file name.

Example Call

// demonstrates getting the directory path of a file
var path;
path = filename_path("C:/Users/Owner/Desktop/mygamefile.txt"); // will return "C:/Users/Owner/Desktop/"