提交 d2590bb9 编写于 作者: B bernard.xiong

add DFS_O_TRUNC option to ELM FatFs interface layer.

git-svn-id: https://rt-thread.googlecode.com/svn/trunk@358 bbd45198-f89e-11dd-88c7-29a3b14d5316
上级 82e7844c
......@@ -108,7 +108,7 @@ struct _FileSystem{
};
typedef struct _FileSystem FileSystem;
/**************************************************************************************************\
/**************************************************************************************************\
FileLocation
----------
* euint32 Sector Sector where the directoryentry of the file/directory can be found.
......
......@@ -142,6 +142,7 @@ int dfs_elm_open(struct dfs_fd* file)
if (file->flags & DFS_O_CREAT) mode |= FA_CREATE_NEW;
if (file->flags & DFS_O_WRONLY) mode |= FA_WRITE;
if (file->flags & DFS_O_TRUNC) mode |= FA_CREATE_ALWAYS;
/* allocate a fd */
fd = (FIL*)rt_malloc(sizeof(FIL));
......
......@@ -28,7 +28,7 @@
#define O_DIRECTORY DFS_O_DIRECTORY
#define S_IFMT DFS_S_IFMT
#define S_IFSOCK DFS_S_IFSOCK
#define S_IFSOCK DFS_S_IFSOCK
#define S_IFLNK DFS_S_IFLNK
#define S_IFREG DFS_S_IFREG
#define S_IFBLK DFS_S_IFBLK
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册