Skip to content

getParentFilePath

Node.js 런타임 필요 ('qsu/node')

지정된 경로보다 한 단계 위의 상위 경로를 반환합니다.

Parameters

이름타입필수기본값
filePathstring
isWindowsnamedboolean
Whether the target operating system to be checked is Windows

named 표시가 있는 파라미터는 Dart에서는 named 파라미터, Python에서는 키워드 인자로 전달됩니다.

Returns

string

Examples

javascript
getParentFilePath('C:\\Windows\\System32', true); // 'C:\Windows'
getParentFilePath('/home/user/text.txt'); // '/home/user'
dart
getParentFilePath('C:\\Windows\\System32', isWindows: true); // 'C:\Windows'
getParentFilePath('/home/user/text.txt'); // '/home/user'
python
getParentFilePath('C:\\Windows\\System32', True) # 'C:\Windows'
getParentFilePath('/home/user/text.txt') # '/home/user'

Released under the MIT License