Skip to content

joinFilePath

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

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

In Dart, the paths parameter accepts only one argument, which is a List.

Parameters

NameTypeRequiredDefault
isWindowsnamedboolean
Whether the target operating system to be checked is Windows
pathsstring[]
A path value consisting of one or more strings. Omit the path separator and put it in the parameter.

named parameters are passed as named parameters in Dart and keyword arguments in Python.

Returns

string

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