Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also .

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also .
Choose a Base Repository
rust-lang/rust
0xAX/rust
12234/rust
4414/rust
APTy/rust
Acidburn0zzz/rust-lang
AerialX/rust
Alinuxfriend/rust
Arreth/rust
CNXTEoEorg/rust
DanielJCampbell/rust
DiamondLovesYou/rust
EllieAdam/rust
Epictetus/rust
GulajavaMinistudio/rust
JamesLinus/rust
MabezDev/rust-xtensa
Manishearth/rust
Nashenas88/rust
NickPepper/rust
P1start/rust
Raul630/rust
SONNYROBOT/rust
Tengfei1010/rust
XAMPPRocky/rust
XiangQingW/rust
Yoric/rust
Zoxc/rust
abossard/rust
alanfalloon/rust
alex/rust
alexcrichton/rust
alexrp/rust
alistra/rust
anasazi/rust
apoelstra/rust
arkaitzj/rust
atris/rust
avr-rust/rust
bendotc/rust
benjaminjackman/rust
berkus/rust
bjadamson/rust
bklooste/rust
blorf/rust-on-gpu
brianloveswords/rust
brson/rust
caiges/rust
catamorphism/rust
cavedweller/rust
charliesome/rust
chengky/rust
chirag08/rust
chmodawk/rust
chrisdew/rust
cjfrisz/rust
crabtw/rust
csae1152/rust
da-x/rust
dbp/rust
delewit/rust
dobkeratops/rust
dojotech/rust
drhodes/rust
driax/rust
eddyb/rust
eholk/rust
ehsan/rust
elliottslaughter/rust
elly/rust
erickt/rust
erikrose/rust
espadrine/rust
eter360/rust
funkill/rust
fzzzy/rust
gilescope/rust
glaubitz/rust
gmfawcett/rust
gordonlw/rust
grahame/rust
graydon/rust
green-panther/rust
gwillen/rust
harnoor992/rust
ids1024/rust
ischeinkman/libnx-rs-std
j-clark/rust
jamorton/rust
janus/rust
jdm/rust
jeanpuga/rust
jensnockert/rust
jld/rust
joelgarciajr84/rust
johnterickson/rust
jorendorff/rust
jrgold/rust
jruderman/rust
jwatt/rust
jwilberding/rust
jwise/rust
jyasskin/rust
kevina/rust
killerswan/rust
kleimkuhler/rust
kosslab-kr/rust
kumasento/rust
levonlloyd/rust
lht/rust
liigo/rust
liufeigit/rust
lkuper/rust
logie17/rust
lunarpulse/rust
macressler/rust
masondesu/rust
matricks/rust
mbrubeck/rust
mcandre/rust
megakorre/rust
mhenes/rust
michaelwoerister/rust
milkowski/rust
miselin/rust
mitsuhiko/rust
mmeyerho/rust
mneumann/rust
mounir34/rust
mpark/rust
mrmonday/rust
mujiatong/rust
muyayo/rust
nathanielherman/rust
nbaksalyar/rust
nbp/rust
nielx/rust
nikomatsakis/rust
nrc/rust
oyiptong/rust
ozzie00/rust
pcwalton/rust
pkarvou/rust
poiru/rust
pwoolcoc/rust
rbancroft/rust
redox-os/rust
reuben/rust
robyoung/rust
rozbb/rust
rpearl/rust
rtanglao/rust
rust-highfive/rust
rustlang/rust
rusty-horizon/horizon-nx-std
rwaldron/rust
samgiles/rust
sarojaba/rust-doc-korean
sayrer/rust
sdeniskos/rust
semarie/rust
sferik/rust
shepmaster/rust
shinglyu/rust
shinta42/rust
sigma318/rust
smaeul/rust
songshaodong/rust
stereotype441/rust
steveklabnik/rust
strangeglyph/rust
sunlightboy/rust
tbu-/rust
tclfs/rust
tedhorst/rust
tfviv79/rust
thomaslee/rust
tohava/rust
tomaka/rust
toshok/rust
tromey/rust
trulliandloeb/rust
tshakah/rust
uasi/rust
vadimcn/rust
varkor/rust
vendula/rust
vhbit/rust
vy12021/rust
waywardmonkeys/rust
webea/rust
wesj/rust
whtoo/rust
williamw520/rust
wilsonk/rust
withoutboats/rust
yamidevs/rust
yodalee/rust
ysbaddaden/rust
zhaobr/rust
Nothing to show
base: master
Choose a Head Repository
rust-lang/rust
0xAX/rust
12234/rust
4414/rust
APTy/rust
Acidburn0zzz/rust-lang
AerialX/rust
Alinuxfriend/rust
Arreth/rust
CNXTEoEorg/rust
DanielJCampbell/rust
DiamondLovesYou/rust
EllieAdam/rust
Epictetus/rust
GulajavaMinistudio/rust
JamesLinus/rust
MabezDev/rust-xtensa
Manishearth/rust
Nashenas88/rust
NickPepper/rust
P1start/rust
Raul630/rust
SONNYROBOT/rust
Tengfei1010/rust
XAMPPRocky/rust
XiangQingW/rust
Yoric/rust
Zoxc/rust
abossard/rust
alanfalloon/rust
alex/rust
alexcrichton/rust
alexrp/rust
alistra/rust
anasazi/rust
apoelstra/rust
arkaitzj/rust
atris/rust
avr-rust/rust
bendotc/rust
benjaminjackman/rust
berkus/rust
bjadamson/rust
bklooste/rust
blorf/rust-on-gpu
brianloveswords/rust
brson/rust
caiges/rust
catamorphism/rust
cavedweller/rust
charliesome/rust
chengky/rust
chirag08/rust
chmodawk/rust
chrisdew/rust
cjfrisz/rust
crabtw/rust
csae1152/rust
da-x/rust
dbp/rust
delewit/rust
dobkeratops/rust
dojotech/rust
drhodes/rust
driax/rust
eddyb/rust
eholk/rust
ehsan/rust
elliottslaughter/rust
elly/rust
erickt/rust
erikrose/rust
espadrine/rust
eter360/rust
funkill/rust
fzzzy/rust
gilescope/rust
glaubitz/rust
gmfawcett/rust
gordonlw/rust
grahame/rust
graydon/rust
green-panther/rust
gwillen/rust
harnoor992/rust
ids1024/rust
ischeinkman/libnx-rs-std
j-clark/rust
jamorton/rust
janus/rust
jdm/rust
jeanpuga/rust
jensnockert/rust
jld/rust
joelgarciajr84/rust
johnterickson/rust
jorendorff/rust
jrgold/rust
jruderman/rust
jwatt/rust
jwilberding/rust
jwise/rust
jyasskin/rust
kevina/rust
killerswan/rust
kleimkuhler/rust
kosslab-kr/rust
kumasento/rust
levonlloyd/rust
lht/rust
liigo/rust
liufeigit/rust
lkuper/rust
logie17/rust
lunarpulse/rust
macressler/rust
masondesu/rust
matricks/rust
mbrubeck/rust
mcandre/rust
megakorre/rust
mhenes/rust
michaelwoerister/rust
milkowski/rust
miselin/rust
mitsuhiko/rust
mmeyerho/rust
mneumann/rust
mounir34/rust
mpark/rust
mrmonday/rust
mujiatong/rust
muyayo/rust
nathanielherman/rust
nbaksalyar/rust
nbp/rust
nielx/rust
nikomatsakis/rust
nrc/rust
oyiptong/rust
ozzie00/rust
pcwalton/rust
pkarvou/rust
poiru/rust
pwoolcoc/rust
rbancroft/rust
redox-os/rust
reuben/rust
robyoung/rust
rozbb/rust
rpearl/rust
rtanglao/rust
rust-highfive/rust
rustlang/rust
rusty-horizon/horizon-nx-std
rwaldron/rust
samgiles/rust
sarojaba/rust-doc-korean
sayrer/rust
sdeniskos/rust
semarie/rust
sferik/rust
shepmaster/rust
shinglyu/rust
shinta42/rust
sigma318/rust
smaeul/rust
songshaodong/rust
stereotype441/rust
steveklabnik/rust
strangeglyph/rust
sunlightboy/rust
tbu-/rust
tclfs/rust
tedhorst/rust
tfviv79/rust
thomaslee/rust
tohava/rust
tomaka/rust
toshok/rust
tromey/rust
trulliandloeb/rust
tshakah/rust
uasi/rust
vadimcn/rust
varkor/rust
vendula/rust
vhbit/rust
vy12021/rust
waywardmonkeys/rust
webea/rust
wesj/rust
whtoo/rust
williamw520/rust
wilsonk/rust
withoutboats/rust
yamidevs/rust
yodalee/rust
ysbaddaden/rust
zhaobr/rust
Nothing to show
compare: portability
Checking mergeability… Don’t worry, you can still create the pull request.
  • 5 commits
  • 11 files changed
  • 0 commit comments
  • 1 contributor

Large diffs are not rendered by default.

Oops, something went wrong.
@@ -501,6 +501,7 @@ pub mod heap;
#[macro_use]
mod sys_common;
mod sys;
mod pal;

// Private support modules
mod panicking;
@@ -0,0 +1,97 @@
// Copyright 2017 The Rust Project Developers. See the COPYRIGHT
// file at the top-level directory of this distribution and at
// http://rust-lang.org/COPYRIGHT.
//
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
// option. This file may not be copied, modified, or distributed
// except according to those terms.

use io;
use cmp::{PartialEq,Eq};
use fmt::Debug;
use path::{Path,PathBuf};
use ffi::OsString;

pub trait FsPal {
type File: FilePal<Self>;
type Metadata: MetadataPal<Self>;
type FileType: FileTypePal;
type Permissions: Clone + PartialEq + Eq + Debug;
type OpenOptions: OpenOptionsPal;
type DirBuilder: DirBuilderPal;
type DirEntry: DirEntryPal<Self>;
type ReadDir: Debug + Iterator<Item=io::Result<Self::DirEntry>>;
type SystemTime;

fn remove_file(path: &Path) -> io::Result<()>;
fn metadata(path: &Path) -> io::Result<Self::Metadata>;
fn symlink_metadata(path: &Path) -> io::Result<Self::Metadata>;
fn rename(from: &Path, to: &Path) -> io::Result<()>;
fn copy(from: &Path, to: &Path) -> io::Result<u64>;
fn hard_link(src: &Path, dst: &Path) -> io::Result<()>;
fn soft_link(src: &Path, dst: &Path) -> io::Result<()>;
fn read_link(path: &Path) -> io::Result<PathBuf>;
fn canonicalize(path: &Path) -> io::Result<PathBuf>;
fn remove_dir(path: &Path) -> io::Result<()>;
fn remove_dir_all(path: &Path) -> io::Result<()>;
fn read_dir(path: &Path) -> io::Result<Self::ReadDir>;
fn set_permissions(path: &Path, perm: Self::Permissions) -> io::Result<()>;
}

pub trait FilePal<Fs: FsPal + ?Sized>: Sized + Debug {
fn open(path: &Path, options: &Fs::OpenOptions) -> io::Result<Self>;
fn read(&self, buf: &mut [u8]) -> io::Result<usize>;
fn write(&self, buf: &[u8]) -> io::Result<usize>;
fn flush(&self) -> io::Result<()>;
fn seek(&self, pos: io::SeekFrom) -> io::Result<u64>;
fn sync_all(&self) -> io::Result<()>;
fn sync_data(&self) -> io::Result<()>;
fn set_len(&self, size: u64) -> io::Result<()>;
fn metadata(&self) -> io::Result<Fs::Metadata>;
fn try_clone(&self) -> io::Result<Self>;
fn set_permissions(&self, perm: Fs::Permissions) -> io::Result<()>;
}

pub trait MetadataPal<Fs: FsPal + ?Sized>: Clone {
fn file_type(&self) -> Fs::FileType;
fn len(&self) -> u64;
fn permissions(&self) -> Fs::Permissions;
fn modified(&self) -> io::Result<Fs::SystemTime>;
fn accessed(&self) -> io::Result<Fs::SystemTime>;
fn created(&self) -> io::Result<Fs::SystemTime>;
}

pub trait FileTypePal {
fn is_dir(&self) -> bool;
fn is_file(&self) -> bool;
fn is_symlink(&self) -> bool;
}

pub trait PermissionsPal {
fn readonly(&self) -> bool;
fn set_readonly(&mut self, readonly: bool);
}

pub trait OpenOptionsPal: Clone + Debug {
fn new() -> Self;
fn read(&mut self, read: bool);
fn write(&mut self, write: bool);
fn append(&mut self, append: bool);
fn truncate(&mut self, truncate: bool);
fn create(&mut self, create: bool);
fn create_new(&mut self, create_new: bool);
}

pub trait DirBuilderPal {
fn new() -> Self;
fn create(&self, path: &Path) -> io::Result<()>;
}

pub trait DirEntryPal<Fs: FsPal + ?Sized> {
fn path(&self) -> PathBuf;
fn metadata(&self) -> io::Result<Fs::Metadata>;
fn file_type(&self) -> io::Result<Fs::FileType>;
fn file_name(&self) -> OsString;
}
@@ -0,0 +1,11 @@
// Copyright 2017 The Rust Project Developers. See the COPYRIGHT
// file at the top-level directory of this distribution and at
// http://rust-lang.org/COPYRIGHT.
//
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
// option. This file may not be copied, modified, or distributed
// except according to those terms.

pub mod fs;
@@ -16,9 +16,10 @@ use fs::{self, Permissions, OpenOptions};
use io;
use libc;
use path::Path;
use sys;
use sys_common::{FromInner, AsInner, AsInnerMut};
use sys::platform::fs::MetadataExt as UnixMetadataExt;
use sys::fs::Fs;
use pal::fs::*;

/// Unix-specific extensions to [`File`].
///
@@ -698,7 +699,7 @@ impl DirEntryExt for fs::DirEntry {
#[stable(feature = "symlink", since = "1.1.0")]
pub fn symlink<P: AsRef<Path>, Q: AsRef<Path>>(src: P, dst: Q) -> io::Result<()>
{
sys::fs::symlink(src.as_ref(), dst.as_ref())
Fs::soft_link(src.as_ref(), dst.as_ref())
}

#[stable(feature = "dir_builder", since = "1.6.0")]
Oops, something went wrong.

No commit comments for this range

You can’t perform that action at this time.