os_calls: Add g_executable_exist()
This commit is contained in:
@@ -2556,6 +2556,14 @@ g_directory_exist(const char *dirname)
|
||||
#endif
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
/* returns boolean, non zero if the file exists and is a readable executable */
|
||||
int
|
||||
g_executable_exist(const char *exename)
|
||||
{
|
||||
return access(exename, R_OK | X_OK) == 0;
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
/* returns boolean */
|
||||
int
|
||||
|
||||
@@ -242,6 +242,7 @@ int g_set_current_dir(const char *dirname);
|
||||
int g_file_exist(const char *filename);
|
||||
int g_file_readable(const char *filename);
|
||||
int g_directory_exist(const char *dirname);
|
||||
int g_executable_exist(const char *dirname);
|
||||
int g_create_dir(const char *dirname);
|
||||
int g_create_path(const char *path);
|
||||
int g_remove_dir(const char *dirname);
|
||||
|
||||
Reference in New Issue
Block a user