Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
R
redoxfs
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
5
Issues
5
List
Boards
Labels
Service Desk
Milestones
Merge Requests
3
Merge Requests
3
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
redox-os
redoxfs
Commits
3872f74e
Verified
Commit
3872f74e
authored
Jul 06, 2019
by
Jeremy Soller
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
0.3.6 - Accept AsRef<Path> for disk path arguments
parent
39e8b8fa
Pipeline
#5142
passed with stages
in 3 minutes and 9 seconds
Changes
4
Pipelines
2
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
7 additions
and
5 deletions
+7
-5
Cargo.lock
Cargo.lock
+1
-1
Cargo.toml
Cargo.toml
+1
-1
src/disk/file.rs
src/disk/file.rs
+3
-2
src/disk/sparse.rs
src/disk/sparse.rs
+2
-1
No files found.
Cargo.lock
View file @
3872f74e
...
...
@@ -97,7 +97,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
[[package]]
name = "redoxfs"
version = "0.3.
5
"
version = "0.3.
6
"
dependencies = [
"fuse 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)",
"libc 0.2.58 (registry+https://github.com/rust-lang/crates.io-index)",
...
...
Cargo.toml
View file @
3872f74e
...
...
@@ -2,7 +2,7 @@
name
=
"redoxfs"
description
=
"The Redox Filesystem"
repository
=
"https://gitlab.redox-os.org/redox-os/redoxfs"
version
=
"0.3.
5
"
version
=
"0.3.
6
"
license-file
=
"LICENSE"
readme
=
"README.md"
authors
=
[
"Jeremy Soller <jackpot51@gmail.com>"
]
...
...
src/disk/file.rs
View file @
3872f74e
use
std
::
fs
::{
File
,
OpenOptions
};
use
std
::
io
::{
Read
,
Write
,
Seek
,
SeekFrom
};
use
std
::
path
::
Path
;
use
syscall
::
error
::{
Error
,
Result
,
EIO
};
use
BLOCK_SIZE
;
...
...
@@ -20,14 +21,14 @@ pub struct DiskFile {
}
impl
DiskFile
{
pub
fn
open
(
path
:
&
str
)
->
Result
<
DiskFile
>
{
pub
fn
open
<
P
:
AsRef
<
Path
>>
(
path
:
P
)
->
Result
<
DiskFile
>
{
let
file
=
try_disk!
(
OpenOptions
::
new
()
.read
(
true
)
.write
(
true
)
.open
(
path
));
Ok
(
DiskFile
{
file
:
file
})
}
pub
fn
create
(
path
:
&
str
,
size
:
u64
)
->
Result
<
DiskFile
>
{
pub
fn
create
<
P
:
AsRef
<
Path
>>
(
path
:
P
,
size
:
u64
)
->
Result
<
DiskFile
>
{
let
file
=
try_disk!
(
OpenOptions
::
new
()
.read
(
true
)
.write
(
true
)
.create
(
true
)
.open
(
path
));
try_disk!
(
file
.set_len
(
size
));
Ok
(
DiskFile
{
...
...
src/disk/sparse.rs
View file @
3872f74e
use
std
::
fs
::{
File
,
OpenOptions
};
use
std
::
io
::{
Read
,
Write
,
Seek
,
SeekFrom
};
use
std
::
path
::
Path
;
use
std
::
u64
;
use
syscall
::
error
::{
Error
,
Result
,
EIO
};
...
...
@@ -21,7 +22,7 @@ pub struct DiskSparse {
}
impl
DiskSparse
{
pub
fn
create
(
path
:
&
str
)
->
Result
<
DiskSparse
>
{
pub
fn
create
<
P
:
AsRef
<
Path
>>
(
path
:
P
)
->
Result
<
DiskSparse
>
{
let
file
=
try_disk!
(
OpenOptions
::
new
()
.read
(
true
)
.write
(
true
)
.create
(
true
)
.open
(
path
));
Ok
(
DiskSparse
{
file
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment