drop -text +filepath
Delete the drive, if it exists.
> dropDrive x == snd (splitDrive x)
Remove last extension, and the "." preceding it.
> dropExtension x == fst (splitExtension x)
Drop all extensions
> not $ hasExtension (dropExtensions x)
Drop the filename.
> dropFileName x == fst (splitFileName x)
Remove any trailing path separators
> dropTrailingPathSeparator "file/test/" == "file/test"
> Posix: not (hasTrailingPathSeparator (dropTrailingPathSeparator x)) || isDrive x
> Posix: dropTrailingPathSeparator "/" == "/"
> Windows: dropTrailingPathSeparator "\\" == "\\"