Skip to content

joinFilePath

Requires a Node.js runtime ('qsu/node')

Combines paths for each operating system according to the given parameter values.

Parameters

NameTypeRequiredDefault
isWindowsnamedkeywordbooleanbool
Whether the target operating system to be checked is Windows
paths...string[]List<String>*str
A path value consisting of one or more strings. Omit the path separator and put it in the parameter.

namedThese parameters are passed as named parameters.

keywordThese parameters are passed as keyword arguments, or as a single dict in their place.

Returns

string

String

str

Examples

javascript
joinFilePath(true, 'C:\\', 'Windows', 'System32'); // 'C:\Windows\System32'
joinFilePath(false, 'home', '/user', '.bashrc'); // '/home/user/.bashrc'
dart
joinFilePath(['C:\\', 'Windows', 'System32'], isWindows: true); // 'C:\Windows\System32'
joinFilePath(['home', '/user', '.bashrc']); // '/home/user/.bashrc'
python
joinFilePath(True, 'C:\\', 'Windows', 'System32') # 'C:\Windows\System32'
joinFilePath(False, 'home', '/user', '.bashrc') # '/home/user/.bashrc'

Released under the MIT License