mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-28 15:24:43 +02:00
8273153: Consolidate file_exists into os:file_exists
Reviewed-by: iklam, ccheung
This commit is contained in:
parent
0609421d4b
commit
9732fbe428
4 changed files with 13 additions and 17 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue