8273153: Consolidate file_exists into os:file_exists

Reviewed-by: iklam, ccheung
This commit is contained in:
Yumin Qi 2021-08-31 00:24:05 +00:00
parent 0609421d4b
commit 9732fbe428
4 changed files with 13 additions and 17 deletions

View file

@ -1395,6 +1395,14 @@ bool os::set_boot_path(char fileSep, char pathSep) {
return false;
}
bool os::file_exists(const char* filename) {
struct stat statbuf;
if (filename == NULL || strlen(filename) == 0) {
return false;
}
return os::stat(filename, &statbuf) == 0;
}
// Splits a path, based on its separator, the number of
// elements is returned back in "elements".
// file_name_length is used as a modifier for each path's