MCPcopy Create free account
hub / github.com/RT-Thread/rt-thread / _msh_lwp_cmd_exists

Function _msh_lwp_cmd_exists

components/finsh/msh.c:358–368  ·  view source on GitHub ↗

check whether a file of the given path exits */

Source from the content-addressed store, hash-verified

356#include <lwp.h>
357/* check whether a file of the given path exits */
358static rt_bool_t _msh_lwp_cmd_exists(const char *path)
359{
360 int fd = -1;
361 fd = open(path, O_RDONLY, 0);
362 if (fd < 0)
363 {
364 return RT_FALSE;
365 }
366 close(fd);
367 return RT_TRUE;
368}
369
370/*
371 * search for the file named "pg_name" or "pg_name.elf" at the given directory,

Callers 1

_msh_exec_search_pathFunction · 0.85

Calls 2

openFunction · 0.50
closeFunction · 0.50

Tested by

no test coverage detected