Skip to content

isValidFileName

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

Determines whether the passed path or filename is using a system-accepted string (Also check the valid file length). Returns false if the name is not available.

Parameters

NameTypeRequiredDefault
filePathstring
File or directory path
unixTypenamedboolean
Passes true if the file type is unix type.

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

Returns

boolean

Examples

javascript
isValidFileName('C:\\Windows\\System32*'); // false
isValidFileName('/home/user/.bashrc', true); // true
dart
isValidFileName('C:\\Windows\\System32*'); // false
isValidFileName('/home/user/.bashrc', unixType: true); // true
python
isValidFileName('C:\\Windows\\System32*') # False
isValidFileName('/home/user/.bashrc', True) # True

Released under the MIT License