💾 Archived View for uhc.megaburken.net › help › formatpath captured on 2021-12-06 at 14:29:53.

View Raw

More Information

⬅️ Previous capture (2021-11-30)

-=-=-=-=-=-=-

FormatPATH - LFORMAT-like formatting of paths

Usage: "PATH" "FORMAT"

formatpath is a script that takes a path as input and can modify it in
different ways. It can remove the extension, get the volume/device-name,
add a trailing slash and more.

NOTE: Both arguments needs citations around them, due to Arexx crappy
      handling of arguments.

The formatting that can be used are the following:
 %D - Device/Volume-name
 %P - Path (without device) up until the last slash
 %F - Filename including extension if present
 %E - Extension including the leading dot (ie .lha)
 %N - Filename without extension
 %X - Extension without the leading dot (ie lha)
 %U - The entire inputted path unmodified
 %S - This special string adds a trailing slash if the character before is
      not a slash or a colon, can be used with %U to make sure a path has
      a trailing slash unless it's a device or already has a trailing slash.

Examples:
 1> formatpath "SYS:S" "%U%S"
 SYS:S/

 1> formatpath "Work:Music/Protracker/" "%D"
 Work:

 1> formatpath "comm/term/ncomm306.lha" "http://aminet.driar.se/%P%N.readme"
 http://aminet.driar.see/comm/term/ncomm306.readme

 1> formatpath "Download:Archived/AwesomeGame.lha" "%X"
 lha