Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
vnotepad
Exa
提交
fdc45079
E
Exa
项目概览
vnotepad
/
Exa
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
E
Exa
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
fdc45079
编写于
6月 17, 2015
作者:
B
Ben S
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #68 from mneumann/dragonfly
Fix compile for DragonflyBSD and nightly rust
上级
b57e82e7
96018841
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
47 addition
and
46 deletion
+47
-46
src/feature/mod.rs
src/feature/mod.rs
+2
-33
src/feature/xattr_dummy.rs
src/feature/xattr_dummy.rs
+32
-0
src/file.rs
src/file.rs
+8
-8
src/options.rs
src/options.rs
+4
-4
src/term.rs
src/term.rs
+1
-1
未找到文件。
src/feature/mod.rs
浏览文件 @
fdc45079
...
@@ -6,39 +6,8 @@
...
@@ -6,39 +6,8 @@
#[cfg(target_os
=
"linux"
)]
mod
xattr_linux
;
#[cfg(target_os
=
"linux"
)]
mod
xattr_linux
;
#[cfg(target_os
=
"linux"
)]
pub
use
self
::
xattr_linux
::
Attribute
;
#[cfg(target_os
=
"linux"
)]
pub
use
self
::
xattr_linux
::
Attribute
;
#[cfg(not(any(target_os
=
"macos"
,
target_os
=
"linux"
)))]
use
std
::
old_io
as
io
;
#[cfg(not(any(target_os
=
"macos"
,
target_os
=
"linux"
)))]
mod
xattr_dummy
;
#[cfg(not(any(target_os
=
"macos"
,
target_os
=
"linux"
)))]
#[cfg(not(any(target_os
=
"macos"
,
target_os
=
"linux"
)))]
pub
use
self
::
xattr_dummy
::
Attribute
;
#[derive(Clone)]
pub
struct
Attribute
;
#[cfg(not(any(target_os
=
"macos"
,
target_os
=
"linux"
)))]
impl
Attribute
{
/// Getter for name
pub
fn
name
(
&
self
)
->
&
str
{
unimplemented!
()
}
/// Getter for size
pub
fn
size
(
&
self
)
->
usize
{
unimplemented!
()
}
/// Lists the extended attributes. Follows symlinks like `metadata`
pub
fn
list
(
_
:
&
Path
)
->
io
::
IoResult
<
Vec
<
Attribute
>>
{
Ok
(
Vec
::
new
())
}
/// Lists the extended attributes. Does not follow symlinks like `symlink_metadata`
pub
fn
llist
(
_
:
&
Path
)
->
io
::
IoResult
<
Vec
<
Attribute
>>
{
Ok
(
Vec
::
new
())
}
pub
fn
feature_implemented
()
->
bool
{
false
}
}
// Git support
// Git support
...
...
src/feature/xattr_dummy.rs
0 → 100644
浏览文件 @
fdc45079
use
std
::
io
;
use
std
::
path
::
Path
;
#[derive(Clone)]
pub
struct
Attribute
;
impl
Attribute
{
/// Getter for name
pub
fn
name
(
&
self
)
->
&
str
{
unimplemented!
()
}
/// Getter for size
pub
fn
size
(
&
self
)
->
usize
{
unimplemented!
()
}
/// Lists the extended attributes. Follows symlinks like `metadata`
pub
fn
list
(
_
:
&
Path
)
->
io
::
Result
<
Vec
<
Attribute
>>
{
Ok
(
Vec
::
new
())
}
/// Lists the extended attributes. Does not follow symlinks like `symlink_metadata`
pub
fn
llist
(
_
:
&
Path
)
->
io
::
Result
<
Vec
<
Attribute
>>
{
Ok
(
Vec
::
new
())
}
pub
fn
feature_implemented
()
->
bool
{
false
}
}
src/file.rs
浏览文件 @
fdc45079
...
@@ -223,7 +223,7 @@ impl<'dir> File<'dir> {
...
@@ -223,7 +223,7 @@ impl<'dir> File<'dir> {
/// with multiple links much more often. Thus, it should get highlighted
/// with multiple links much more often. Thus, it should get highlighted
/// more attentively.
/// more attentively.
pub
fn
links
(
&
self
)
->
f
::
Links
{
pub
fn
links
(
&
self
)
->
f
::
Links
{
let
count
=
self
.metadata
.
as_raw
()
.
nlink
();
let
count
=
self
.metadata
.nlink
();
f
::
Links
{
f
::
Links
{
count
:
count
,
count
:
count
,
...
@@ -233,7 +233,7 @@ impl<'dir> File<'dir> {
...
@@ -233,7 +233,7 @@ impl<'dir> File<'dir> {
/// This file's inode.
/// This file's inode.
pub
fn
inode
(
&
self
)
->
f
::
Inode
{
pub
fn
inode
(
&
self
)
->
f
::
Inode
{
f
::
Inode
(
self
.metadata
.
as_raw
()
.
ino
())
f
::
Inode
(
self
.metadata
.ino
())
}
}
/// This file's number of filesystem blocks.
/// This file's number of filesystem blocks.
...
@@ -241,7 +241,7 @@ impl<'dir> File<'dir> {
...
@@ -241,7 +241,7 @@ impl<'dir> File<'dir> {
/// (Not the size of each block, which we don't actually report on)
/// (Not the size of each block, which we don't actually report on)
pub
fn
blocks
(
&
self
)
->
f
::
Blocks
{
pub
fn
blocks
(
&
self
)
->
f
::
Blocks
{
if
self
.is_file
()
||
self
.is_link
()
{
if
self
.is_file
()
||
self
.is_link
()
{
f
::
Blocks
::
Some
(
self
.metadata
.
as_raw
()
.
blocks
())
f
::
Blocks
::
Some
(
self
.metadata
.blocks
())
}
}
else
{
else
{
f
::
Blocks
::
None
f
::
Blocks
::
None
...
@@ -250,12 +250,12 @@ impl<'dir> File<'dir> {
...
@@ -250,12 +250,12 @@ impl<'dir> File<'dir> {
/// The ID of the user that own this file.
/// The ID of the user that own this file.
pub
fn
user
(
&
self
)
->
f
::
User
{
pub
fn
user
(
&
self
)
->
f
::
User
{
f
::
User
(
self
.metadata
.
as_raw
()
.
uid
())
f
::
User
(
self
.metadata
.uid
())
}
}
/// The ID of the group that owns this file.
/// The ID of the group that owns this file.
pub
fn
group
(
&
self
)
->
f
::
Group
{
pub
fn
group
(
&
self
)
->
f
::
Group
{
f
::
Group
(
self
.metadata
.
as_raw
()
.
gid
())
f
::
Group
(
self
.metadata
.gid
())
}
}
/// This file's size, if it's a regular file.
/// This file's size, if it's a regular file.
...
@@ -275,9 +275,9 @@ impl<'dir> File<'dir> {
...
@@ -275,9 +275,9 @@ impl<'dir> File<'dir> {
/// One of this file's timestamps, as a number in seconds.
/// One of this file's timestamps, as a number in seconds.
pub
fn
timestamp
(
&
self
,
time_type
:
TimeType
)
->
f
::
Time
{
pub
fn
timestamp
(
&
self
,
time_type
:
TimeType
)
->
f
::
Time
{
let
time_in_seconds
=
match
time_type
{
let
time_in_seconds
=
match
time_type
{
TimeType
::
FileAccessed
=>
self
.metadata
.a
s_raw
()
.a
time
(),
TimeType
::
FileAccessed
=>
self
.metadata
.atime
(),
TimeType
::
FileModified
=>
self
.metadata
.
as_raw
()
.
mtime
(),
TimeType
::
FileModified
=>
self
.metadata
.mtime
(),
TimeType
::
FileCreated
=>
self
.metadata
.
as_raw
()
.
ctime
(),
TimeType
::
FileCreated
=>
self
.metadata
.ctime
(),
};
};
f
::
Time
(
time_in_seconds
)
f
::
Time
(
time_in_seconds
)
...
...
src/options.rs
浏览文件 @
fdc45079
...
@@ -132,10 +132,10 @@ impl FileFilter {
...
@@ -132,10 +132,10 @@ impl FileFilter {
SortField
::
Unsorted
=>
{},
SortField
::
Unsorted
=>
{},
SortField
::
Name
=>
files
.sort_by
(|
a
,
b
|
natord
::
compare
(
&*
a
.name
,
&*
b
.name
)),
SortField
::
Name
=>
files
.sort_by
(|
a
,
b
|
natord
::
compare
(
&*
a
.name
,
&*
b
.name
)),
SortField
::
Size
=>
files
.sort_by
(|
a
,
b
|
a
.metadata
.len
()
.cmp
(
&
b
.metadata
.len
())),
SortField
::
Size
=>
files
.sort_by
(|
a
,
b
|
a
.metadata
.len
()
.cmp
(
&
b
.metadata
.len
())),
SortField
::
FileInode
=>
files
.sort_by
(|
a
,
b
|
a
.metadata
.
as_raw
()
.ino
()
.cmp
(
&
b
.metadata
.as_raw
()
.ino
())),
SortField
::
FileInode
=>
files
.sort_by
(|
a
,
b
|
a
.metadata
.
ino
()
.cmp
(
&
b
.metadata
.ino
())),
SortField
::
ModifiedDate
=>
files
.sort_by
(|
a
,
b
|
a
.metadata
.
as_raw
()
.mtime
()
.cmp
(
&
b
.metadata
.as_raw
()
.mtime
())),
SortField
::
ModifiedDate
=>
files
.sort_by
(|
a
,
b
|
a
.metadata
.
mtime
()
.cmp
(
&
b
.metadata
.mtime
())),
SortField
::
AccessedDate
=>
files
.sort_by
(|
a
,
b
|
a
.metadata
.a
s_raw
()
.atime
()
.cmp
(
&
b
.metadata
.as_raw
()
.atime
())),
SortField
::
AccessedDate
=>
files
.sort_by
(|
a
,
b
|
a
.metadata
.a
time
()
.cmp
(
&
b
.metadata
.atime
())),
SortField
::
CreatedDate
=>
files
.sort_by
(|
a
,
b
|
a
.metadata
.
as_raw
()
.ctime
()
.cmp
(
&
b
.metadata
.as_raw
()
.ctime
())),
SortField
::
CreatedDate
=>
files
.sort_by
(|
a
,
b
|
a
.metadata
.
ctime
()
.cmp
(
&
b
.metadata
.ctime
())),
SortField
::
Extension
=>
files
.sort_by
(|
a
,
b
|
match
a
.ext
.cmp
(
&
b
.ext
)
{
SortField
::
Extension
=>
files
.sort_by
(|
a
,
b
|
match
a
.ext
.cmp
(
&
b
.ext
)
{
cmp
::
Ordering
::
Equal
=>
natord
::
compare
(
&*
a
.name
,
&*
b
.name
),
cmp
::
Ordering
::
Equal
=>
natord
::
compare
(
&*
a
.name
,
&*
b
.name
),
order
=>
order
,
order
=>
order
,
...
...
src/term.rs
浏览文件 @
fdc45079
...
@@ -16,7 +16,7 @@ mod c {
...
@@ -16,7 +16,7 @@ mod c {
#[cfg(any(target_os
=
"linux"
,
target_os
=
"android"
))]
#[cfg(any(target_os
=
"linux"
,
target_os
=
"android"
))]
static
TIOCGWINSZ
:
c_ulong
=
0x5413
;
static
TIOCGWINSZ
:
c_ulong
=
0x5413
;
#[cfg(any(target_os
=
"macos"
,
target_os
=
"ios"
))]
#[cfg(any(target_os
=
"macos"
,
target_os
=
"ios"
,
target_os
=
"dragonfly"
))]
static
TIOCGWINSZ
:
c_ulong
=
0x40087468
;
static
TIOCGWINSZ
:
c_ulong
=
0x40087468
;
extern
{
extern
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录