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
- App.GetProcessPath
- DynaPDF.Initialize
- Files.WriteFile
- Path.FileMakerPathToNativePath
- Path.LastPathComponent
- Plugin.Path
Release notes
- Version 9.2
- Fixed problem with Path.RemoveLastPathComponent and path ending with (back)slash.
Example Databases
Blog Entries
This function checks for a license.
Created 30th November 2015, last changed 28th August 2019
