📄 fs28stat.c
字号:
#ifdef FSS_FTR#define ACCESS_RIGHTS_INTERNAL_FS#define FS28STAT_C#undef FILE_NUMBER#define FILE_NUMBER 28 #include "Fs.h"#undef PROCEDURE_NUMBER #define PROCEDURE_NUMBER 1void Fs28_01Stat( void * pp_Param ){ t_fsEntityStruct * pl_FsEntityPtr = 0; /* Pointer on entity's CB */ fssPath * pl_RestOfPath; /* Point in the path after the volume name or if the current path is available pointer on it */ t_ObjectInfo sl_Info; /* Information on an object given from LL */ t_fsVolStruct * pl_Volume; t_FsCmdStat * pl_Param = ( t_FsCmdStat *) pp_Param; /* Get entity's context pointer if current directory is used ( no slatch in file path ) */ if ( *pl_Param->p_Path != '/') 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 volume unknow -> err */ if ( pl_Volume == 0 ) return; /* Set the interlayer table pointer */ MC_FS_LL_SET_NEW_VOL(pl_Volume); /* 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 ) && ( MC_FS_STATUS(pl_Param) != FSS_ERR_MEMORY_CORRUPTED )) /* When the error FSS_ERR_MEMORY_CORRUPTED occurs, the structure has to be updated */ return; /* This object exist ? if no return error */ if ( sl_Info.s_FileStatus.v_ObjExist == FALSE ) { /* Err unknow object */ MC_FS_STATUS(pl_Param) = FSS_ENOENT; return ; } /* Update stat structure */ pl_Param->p_FileInfo->s_fss_st_mode = FS_IRWXU | FS_IRWXG | FS_IRWXO; if ( sl_Info.s_FileStatus.v_ObjIsFile == FALSE ) pl_Param->p_FileInfo->s_fss_st_mode |= ( FS_TYPE_DIRECTORY << FS_POS_FILE_TYPE ) ; pl_Param->p_FileInfo->s_fss_st_size = sl_Info.v_FileSize;}#undef PROCEDURE_NUMBER #define PROCEDURE_NUMBER 2u32 Fs28_02ProcessStat( const fssPath * pp_Path, t_fss_stat * pp_FileInfo){ /* Reserve message space */ t_FsCmdStat * pl_Stat = (t_FsCmdStat *) MC_FS_GET_MEMORY(sizeof(t_FsCmdStat)); /* Fill message with input parameters */ pl_Stat->p_Path = pp_Path; pl_Stat->p_FileInfo = pp_FileInfo; /* Send message by setting operation and return command identifier */ return( MC_FS_MA_SEND_CMD_MSG_TO_FS (FS_WITH_ACK, (void*)pl_Stat, FS_CMD_STAT_REQ));}#endif /* FSS_FTR */
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -