Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitb701dce

Browse files
authored
gh-102765: Update ntpath.isdir/isfile/islink/exists to use GetFileInformationByName when available (GH-103485)
1 parent8a0c7f1 commitb701dce

File tree

2 files changed

+209
-118
lines changed

2 files changed

+209
-118
lines changed

‎Include/internal/pycore_fileutils_windows.h‎

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,24 @@ static inline BOOL _Py_GetFileInformationByName(
7575
returnGetFileInformationByName(FileName,FileInformationClass,FileInfoBuffer,FileInfoBufferSize);
7676
}
7777

78+
staticinlineBOOL_Py_GetFileInformationByName_ErrorIsTrustworthy(interror)
79+
{
80+
switch(error) {
81+
caseERROR_FILE_NOT_FOUND:
82+
caseERROR_PATH_NOT_FOUND:
83+
caseERROR_NOT_READY:
84+
caseERROR_BAD_NET_NAME:
85+
caseERROR_BAD_NETPATH:
86+
caseERROR_BAD_PATHNAME:
87+
caseERROR_INVALID_NAME:
88+
caseERROR_FILENAME_EXCED_RANGE:
89+
return TRUE;
90+
caseERROR_NOT_SUPPORTED:
91+
return FALSE;
92+
}
93+
return FALSE;
94+
}
95+
7896
#endif
7997

8098
#endif

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp