1 /* 2 * Copyright (C) 2015-2020 Alibaba Group Holding Limited 3 */ 4 5 #ifndef AMP_FS_H 6 #define AMP_FS_H 7 8 #include <fcntl.h> 9 #include "amp_platform.h" 10 11 #ifdef AOS_COMP_VFS 12 #include <aos/vfs.h> 13 #endif 14 15 #if defined(__cplusplus) 16 extern "C" { 17 #endif 18 19 /** 20 * @brief aos_fs_init() initializes vfs system. 21 * 22 * @param[in] NULL 23 * 24 * @return On success, return new file descriptor. 25 * On error, negative error code is returned to indicate the cause 26 * of the error. 27 */ 28 int aos_fs_init(); 29 30 int aos_rmdir_r(const char *path); 31 32 /** 33 * @brief get file system used size in bytes; 34 * 35 * @return fs used size in bytes; negative if failed. 36 */ 37 int aos_fs_usedsize(void); 38 39 /** 40 * @brief get file system free size in bytes; 41 * 42 * @return fs free size in bytes; negative if failed. 43 */ 44 int aos_fs_freesize(void); 45 46 /** 47 * @brief kv componment(key-value) initialize 48 * 49 * @return 0: success, -1: failed 50 */ 51 int aos_fs_type(unsigned int mode); 52 53 54 #if defined(__cplusplus) 55 } 56 #endif 57 #endif /* AMP_FS_H */ 58