Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
RT-Thread
rt-thread
提交
cd3f0f9c
R
rt-thread
项目概览
RT-Thread
/
rt-thread
10 个月 前同步成功
通知
753
Star
8909
Fork
4735
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
R
rt-thread
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
前往新版Gitcode,体验更适合开发者的 AI 搜索 >>
未验证
提交
cd3f0f9c
编写于
6月 11, 2023
作者:
B
Bernard Xiong
提交者:
GitHub
6月 11, 2023
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Add color ls for executable file. (#7654)
上级
0cb2a5e7
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
14 addition
and
11 deletion
+14
-11
components/dfs/dfs_v2/filesystems/tmpfs/dfs_tmpfs.c
components/dfs/dfs_v2/filesystems/tmpfs/dfs_tmpfs.c
+8
-10
components/dfs/dfs_v2/src/dfs_file.c
components/dfs/dfs_v2/src/dfs_file.c
+6
-1
未找到文件。
components/dfs/dfs_v2/filesystems/tmpfs/dfs_tmpfs.c
浏览文件 @
cd3f0f9c
...
...
@@ -111,9 +111,9 @@ static int _free_subdir(struct tmpfs_file *dfile)
return
0
;
}
static
int
dfs_tmpfs_mount
(
struct
dfs_mnt
*
mnt
,
unsigned
long
rwflag
,
const
void
*
data
)
static
int
dfs_tmpfs_mount
(
struct
dfs_mnt
*
mnt
,
unsigned
long
rwflag
,
const
void
*
data
)
{
struct
tmpfs_sb
*
superblock
;
...
...
@@ -295,7 +295,6 @@ static int dfs_tmpfs_read(struct dfs_file *file, void *buf, size_t count, off_t
return
length
;
}
static
int
dfs_tmpfs_write
(
struct
dfs_file
*
file
,
const
void
*
buf
,
size_t
count
,
off_t
*
pos
)
{
struct
tmpfs_file
*
d_file
;
...
...
@@ -347,13 +346,13 @@ static int dfs_tmpfs_lseek(struct dfs_file *file, off_t offset, int wherece)
return
-
EIO
;
}
int
dfs_tmpfs_close
(
struct
dfs_file
*
file
)
static
int
dfs_tmpfs_close
(
struct
dfs_file
*
file
)
{
RT_ASSERT
(
file
->
vnode
->
ref_count
>
0
);
return
RT_EOK
;
}
int
dfs_tmpfs_open
(
struct
dfs_file
*
file
)
static
int
dfs_tmpfs_open
(
struct
dfs_file
*
file
)
{
struct
tmpfs_file
*
d_file
;
...
...
@@ -416,7 +415,7 @@ static int dfs_tmpfs_stat(struct dfs_dentry *dentry, struct stat *st)
return
RT_EOK
;
}
int
dfs_tmpfs_getdents
(
struct
dfs_file
*
file
,
static
int
dfs_tmpfs_getdents
(
struct
dfs_file
*
file
,
struct
dirent
*
dirp
,
uint32_t
count
)
{
...
...
@@ -471,7 +470,7 @@ int dfs_tmpfs_getdents(struct dfs_file *file,
return
count
*
sizeof
(
struct
dirent
);
}
int
dfs_tmpfs_unlink
(
struct
dfs_dentry
*
dentry
)
static
int
dfs_tmpfs_unlink
(
struct
dfs_dentry
*
dentry
)
{
rt_size_t
size
;
struct
tmpfs_sb
*
superblock
;
...
...
@@ -497,7 +496,7 @@ int dfs_tmpfs_unlink(struct dfs_dentry *dentry)
return
RT_EOK
;
}
int
dfs_tmpfs_rename
(
struct
dfs_dentry
*
old_dentry
,
struct
dfs_dentry
*
new_dentry
)
static
int
dfs_tmpfs_rename
(
struct
dfs_dentry
*
old_dentry
,
struct
dfs_dentry
*
new_dentry
)
{
struct
tmpfs_file
*
d_file
,
*
p_file
;
struct
tmpfs_sb
*
superblock
;
...
...
@@ -538,7 +537,6 @@ int dfs_tmpfs_rename(struct dfs_dentry *old_dentry, struct dfs_dentry *new_dentr
return
RT_EOK
;
}
static
struct
dfs_vnode
*
_dfs_tmpfs_lookup
(
struct
dfs_dentry
*
dentry
)
{
struct
dfs_vnode
*
vnode
=
RT_NULL
;
...
...
components/dfs/dfs_v2/src/dfs_file.c
浏览文件 @
cd3f0f9c
...
...
@@ -1668,6 +1668,11 @@ void ls(const char *pathname)
rt_kprintf
(
_COLOR_RED
"-> link_error
\n
"
_COLOR_NORMAL
);
}
}
else
if
(
stat
.
st_mode
&
(
S_IXUSR
|
S_IXGRP
|
S_IXOTH
))
{
rt_kprintf
(
_COLOR_GREEN
"%-20s"
_COLOR_NORMAL
,
dirent
.
d_name
);
rt_kprintf
(
"%-25lu
\n
"
,
(
unsigned
long
)
stat
.
st_size
);
}
else
{
rt_kprintf
(
"%-20s"
,
dirent
.
d_name
);
...
...
@@ -1676,7 +1681,7 @@ void ls(const char *pathname)
}
else
{
rt_kprintf
(
"BAD file: %s
\n
"
,
dirent
.
d_name
);
rt_kprintf
(
_COLOR_RED
"%-20s"
_COLOR_NORMAL
,
dirent
.
d_name
);
}
rt_free
(
fullpath
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录