Check js file exist or not

In win env, only use function `_fullpath` can't check file exist or not, should add function `_access` to check access permissions

Issue: I9VLIQ

Signed-off-by: shitao <shitao40@huawei.com>
Change-Id: Ib206eed473101a3648f4d7dbfd732d95a08427bc
This commit is contained in:
shitao 2024-06-06 11:27:05 +08:00
parent 3c0506e64f
commit 12244acd91

View File

@ -128,7 +128,7 @@ public:
constexpr size_t MAX_PATH_LEN = 2048;
std::array<char, MAX_PATH_LEN> buffer = {0};
auto fp = _fullpath(buffer.data(), relative_path.data(), buffer.size() - 1);
if (fp == nullptr) {
if (fp == nullptr || _access(buffer.data(), 0) == -1) {
return Unexpected(Error(errno));
}