# get_file_name

Definition: | string filename = get_file_name(string path)
Description: | Extract the file name portion of a filepath. path: the filepath from which to extract information. Returns a string, the file name part of path.
pwa/p2js: | Supported (after all it is only a bit of text extraction).
Comments: | Uses get_proper_path(), so on Windows if the file exists the case of the result will match the actual file. Both forwardslash ('/') and backslash ('\\') are handled for all platforms.
Auxillary function: | string {name, path} = get_file_name_and_path(string filepath, bool dropslash=true) Convenience function that avoids having to invoke both get_file_name() and get_file_path(), with the same parameter. Note there is also a get_file_path_and_name() function which returns the same values the other way round, for when that seems more natural, besides having both means one less thing for the compiler to get all snooty and uppity about.
Example: |
    ?get_file_name("C:/Program Files (x86)/Phix/builtins/vm/papnd.e")   -- displays "pApnd.e"
Implementation: | See builtins\file_utils.e (an autoinclude) for details of the actual implementation.
See Also: | get_proper_path, get_file_base, get_file_extension
Technicalia | For compatibility with Euphoria, filename() is a simple alias of get_file_name(), and behaves identically. However for aesthetic reasons/because it is in my opinion a very poor choice of function name/simply way too annoying and misleading, filename is not syntax-coloured in Edita/Edix. UPDATE: the filename alias gave me jip and was therefore removed 25/11/16.