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

Function dfs_file_is_open

components/dfs/dfs_v1/src/dfs_file.c:155–173  ·  view source on GitHub ↗

* This function will return whether this file has been opend. * * @param pathname the file path name. * * @return 0 on file has been open successfully, -1 on open failed. */

Source from the content-addressed store, hash-verified

153 * @return 0 on file has been open successfully, -1 on open failed.
154 */
155int dfs_file_is_open(const char *pathname)
156{
157 char *fullpath = NULL;
158 struct dfs_vnode *vnode = NULL;
159 int ret = 0;
160
161 fullpath = dfs_normalize_path(NULL, pathname);
162
163 dfs_fm_lock();
164 vnode = dfs_vnode_find(fullpath, NULL);
165 if (vnode)
166 {
167 ret = 1;
168 }
169 dfs_fm_unlock();
170
171 rt_free(fullpath);
172 return ret;
173}
174
175
176/**

Callers 2

dfs_file_unlinkFunction · 0.85
dfs_file_renameFunction · 0.85

Calls 5

dfs_fm_lockFunction · 0.85
dfs_vnode_findFunction · 0.85
dfs_fm_unlockFunction · 0.85
rt_freeFunction · 0.85
dfs_normalize_pathFunction · 0.70

Tested by

no test coverage detected