Components All New MacOS Windows Linux iOS
Examples Mac & Win Server Client Guides Statistic FMM Blog Deprecated Old

Path.RemoveLastPathComponent

Removes last path component.

Component Version macOS Windows Linux Server iOS SDK
Path 6.0 ✅ Yes ✅ Yes ✅ Yes ✅ Yes ✅ Yes
MBS( "Path.RemoveLastPathComponent"; Path )   More

Parameters

Parameter Description Example
Path The native file path. "/Users/cs/Desktop"

Result

Returns path or error.

Description

Removes last path component.

This function requires a native path. Use Path.FileMakerPathToNativePath to convert a FileMaker path to a native path if required. If you like to have the user choose the path, you can use FileDialog functions.
For Server be aware that server has limited permissions and may not be able to access all files on a computer.

Examples

Removes last path component on Windows:

MBS( "Path.RemoveLastPathComponent"; "c:\\test.txt" )

Get app folder path:

MBS( "Path.RemoveLastPathComponent"; MBS( "App.GetProcessPath" ))

Query plugin folder:

MBS( "Path.RemoveLastPathComponent"; MBS( "Plugin.Path" ) )

Example result: "/Applications/FileMaker Pro 18 Advanced/Extensions"

See also

Release notes

Example Databases

Blog Entries

This function is free to use.

Created 30th November 2015, last changed 20th February 2024


Path.NativePathToFileMakerPath - Path.ShortPath