Skip to content

dos_compactpath

Dale Fugier edited this page Jul 1, 2026 · 1 revision

Truncates a path to fit within a certain number of characters by replacing path components with ellipses.

Syntax

(dos_compactpath path maxchars)

Parameters

path

A string containing a qualified path.

maxchars

The maximum number of characters to be contained in the new string.

Returns

A string containing a qualified, compact path if successful.

nil on error.

Example

Command: (dos_compactpath "C:\\Program Files\\AutoCAD 2006\\acad.exe" 30)
"C:\\Program Files\\...\\acad.exe"

Command: (dos_compactpath "C:\\Windows\\win.ini" 12)
"...\\win.ini"

Clone this wiki locally