Skip to content
Snippets Groups Projects
Commit 0efcd248 authored by ruslan.laishev's avatar ruslan.laishev 💬
Browse files

Merge branch 'develop' of https://gitlab.demlabs.net/cellframe/cellframe-sdk into develop

parents 44b2821c 71a3e7c7
No related branches found
No related tags found
1 merge request!512bugfix-5760
......@@ -72,6 +72,16 @@ extern "C" {
bool dap_valid_ascii_symbols(const char *a_dir_path);
/**
* @brief dap_file_simple_test
* test if file presented without specific file system attributic
*
* @param a_file_path
* @return true
* @return false
*/
bool dap_file_simple_test(const char * a_file_path);
/**
* Check the file for exists
*
......
......@@ -66,6 +66,30 @@ bool dap_valid_ascii_symbols(const char *a_string)
return true;
}
/**
* Check the file for exists
*
* @a_file_path filename pathname
* @return true, if file exists
*/
bool dap_file_simple_test(const char * a_file_path)
{
if(!a_file_path)
return false;
#ifdef _WIN32
int attr = GetFileAttributesA(a_file_path);
if(attr != -1)
return true;
#else
struct stat st;
if (!stat(a_file_path, &st)) {
if (S_ISREG(st.st_mode))
return true;
}
#endif
return false;
}
/**
* Check the file for exists
*
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment