📄 fs46mkdir.c
字号:
#ifdef FSS_FTR#define ACCESS_RIGHTS_INTERNAL_FS#define FS46MKDIR_C#include "Fs.h"#undef FILE_NUMBER#define FILE_NUMBER 46 #undef PROCEDURE_NUMBER #define PROCEDURE_NUMBER 1void Fs46_01MakeDir( void * pp_Param ){ t_FsCmdMkDir * pl_Param = (t_FsCmdMkDir *) pp_Param; fsPath * pl_RestOfPath; /* Point in the path after the volume name or if the current path is available pointer on it */ t_ObjectInfo sl_Info; t_fsEntityStruct * pl_FsEntityPtr; /* Pointer on entity's CB */ t_fsVolStruct * pl_Volume; /* Get entity's context pointer */ pl_FsEntityPtr = MC_FS_ED_GET_ENTITY_PTR( MC_FS_KERNEL_ID(pl_Param) ); /* Get volume of object */ pl_Volume = MC_FS_CO_GIVE_VOLUME_FROM_PATH ( pl_FsEntityPtr, (fssPath*)pl_Param->p_Path, &pl_RestOfPath, &sl_Info, &MC_FS_STATUS(pl_Param)); /* If no volume return ( status was update by function ) */ if ( pl_Volume == NIL ) return; /* Set the interlayer table pointer */ MC_FS_LL_SET_NEW_VOL(pl_Volume); /* If rest of path empty no file name can be present -> err */ if ( pl_RestOfPath == NIL) { MC_FS_STATUS(pl_Param) = FS_ENOENT; return; } /* Take info on object ( dir exist, object exist, ...) at low layers */ MC_FS_LL_GET_OBJECT_INFO (&sl_Info, pl_RestOfPath, &MC_FS_STATUS(pl_Param)); /* If an error in info get return */ if ( MC_FS_STATUS(pl_Param) != FS_OK ) return; /* See if the directory which will contains the file exist */ if ( sl_Info.s_FileStatus.v_DirExist == FALSE ) { /* Updates status in interface structure and return */ MC_FS_STATUS(pl_Param) = FS_ENOENT; return; } /* This object exist already? -> error */ if ( sl_Info.s_FileStatus.v_ObjExist ) { /* Updates status in interface structure and return */ MC_FS_STATUS(pl_Param) = FS_EEXIST; return; } /* Creates object through lower layers ( FM ) */ MC_FS_LL_CREATE_OBJ( &sl_Info, 0, FS_OBJECT_DIR, &MC_FS_STATUS(pl_Param) ); }#undef PROCEDURE_NUMBER #define PROCEDURE_NUMBER 2u32 Fs46_02ProcessMkDir( u8 vp_Behaviour, const fsPath * pp_Path, t_fs_mod_t vp_Mode ){ /* Reserve message space */ t_FsCmdMkDir * pl_MkDir = ( t_FsCmdMkDir *) MC_FS_GET_MEMORY(sizeof(t_FsCmdMkDir)); /* Fill message with input parameters */ pl_MkDir->p_Path = pp_Path; pl_MkDir->v_Mode = vp_Mode; /* Send message by setting operation and return command identifier */ return( MC_FS_MA_SEND_CMD_MSG_TO_FS(vp_Behaviour, (void*)pl_MkDir,FS_CMD_MKDIR_REQ));}#endif /* FSS_FTR */
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -