mirror of
https://gitee.com/openharmony/arkcompiler_runtime_core
synced 2024-11-27 08:50:45 +00:00
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:
parent
3c0506e64f
commit
12244acd91
@ -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));
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user