quote path
This function preconditions path and file names before they can be used for operating system calls. This function takes care of putting names into quoatation marks if spaces are contained, and directory symbols (slash, backslash) are corrected so they fit with the target operating system and you can use them to compose the command to use with the system() function. Your benefit is that you can use neutral path and file names (as is the case with directory and file system functions, too),
Indirect parameter passing is disabled.
The OS-specific directory separators and quotation mark rules on names with blanks will be applied accordingly.
1
No. | Type | Description |
---|---|---|
1 input |
string | Path or file name This path or file name will be preconditioned |
Type | Description |
---|---|
string | Preconditioned path or file name |
echo( quote path( "C:/program files/B4P/B4P.exe") ); // Quotation marks added and separators aligned
echo( quote path( "..\Test Directory\Test123/Subdir") ); // "
echo( quote path( "Countries/*.xlsx") ); // Directory separator will be aligned for Windows
echo( quote path( "Username\Nic\Programs") ); // No changes made (if executed under Windows)
echo( quote path( "Username/Nic/Programs") ); // Windows: Corrects sepearators. Linux: Puts into quotation marks
C:\"program files"\B4P\B4P.exe
..\"Test Directory"\Test123\Subdir
Countries\*.xlsx
Username\Nic\Programs
Username\Nic\Programs