Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
R
redoxfs
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Will Angenent
redoxfs
Commits
a226d190
Verified
Commit
a226d190
authored
5 years ago
by
Jeremy Soller
Browse files
Options
Downloads
Patches
Plain Diff
Implement symlinks and fix truncation
parent
7b661e31
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/bin/ar.rs
+12
-1
12 additions, 1 deletion
src/bin/ar.rs
with
12 additions
and
1 deletion
src/bin/ar.rs
+
12
−
1
View file @
a226d190
...
...
@@ -6,6 +6,7 @@ use std::{env, fs, process};
use
std
::
io
::{
self
,
Read
};
use
std
::
path
::
Path
;
use
std
::
time
::{
SystemTime
,
UNIX_EPOCH
};
use
std
::
os
::
unix
::
ffi
::
OsStrExt
;
use
std
::
os
::
unix
::
fs
::
MetadataExt
;
use
redoxfs
::{
BLOCK_SIZE
,
Disk
,
DiskSparse
,
Extent
,
FileSystem
,
Node
};
...
...
@@ -66,6 +67,16 @@ fn archive_at<D: Disk, P: AsRef<Path>>(fs: &mut FileSystem<D>, parent_path: P, p
metadata
.mtime
()
as
u64
,
metadata
.mtime_nsec
()
as
u32
)
.map_err
(
syscall_err
)
?
;
}
else
if
file_type
.is_symlink
()
{
let
destination
=
fs
::
read_link
(
path
)
?
;
let
data
=
destination
.as_os_str
()
.as_bytes
();
fs
.write_node
(
node
.0
,
0
,
&
data
,
metadata
.mtime
()
as
u64
,
metadata
.mtime_nsec
()
as
u32
)
.map_err
(
syscall_err
)
?
;
}
else
{
return
Err
(
io
::
Error
::
new
(
io
::
ErrorKind
::
Other
,
...
...
@@ -93,7 +104,7 @@ fn archive<D: Disk, P: AsRef<Path>>(fs: &mut FileSystem<D>, parent_path: P) -> i
let
header
=
fs
.header
;
fs
.write_at
(
header
.0
,
&
header
.1
)
.map_err
(
syscall_err
)
?
;
Ok
(
end_size
)
Ok
(
header
.0
*
BLOCK_SIZE
+
end_size
)
}
fn
main
()
{
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment