pub struct PosixPath { is_absolute: bool, components: ~[~str], }
impl PosixPath
fn stat(&self) -> Option<stat>
fn exists(&self) -> bool
fn get_size(&self) -> Option<i64>
fn get_mode(&self) -> Option<uint>
fn each_parent(&self, f: &fn(&Path))
Executes a function f
on self
as well as on all of its ancestors.
impl PosixPath
fn get_atime(&self) -> Option<(i64, int)>
fn get_mtime(&self) -> Option<(i64, int)>
fn get_ctime(&self) -> Option<(i64, int)>
impl PosixPath
impl Clone for PosixPath
fn clone(&self) -> PosixPath
Returns a copy of the value. The contents of owned pointers are copied to maintain uniqueness, while the contents of managed pointers are not copied.
impl Eq for PosixPath
impl ToStr for PosixPath
fn to_str(&self) -> ~str
Converts the value of self
to an owned string
impl ToCStr for PosixPath
fn to_c_str(&self) -> CString
Copy the receiver into a CString.
Raises the null_byte
condition if the receiver has an interior null.
unsafe fn to_c_str_unchecked(&self) -> CString
Unsafe variant of to_c_str()
that doesn't check for nulls.
impl GenericPath for PosixPath
fn from_str(s: &str) -> PosixPath
Converts a string to a path.
fn with_dirname(&self, d: &str) -> PosixPath
Returns a new path consisting of self
with the parent directory component replaced
with the given string.
fn with_filename(&self, f: &str) -> PosixPath
Returns a new path consisting of self
with the file component replaced
with the given string.
fn file_path(&self) -> PosixPath
Returns the file component of self
, as a new path.
If self
names a directory, returns the empty path.
fn push(&self, s: &str) -> PosixPath
Returns a new path whose parent directory is self
and whose
file component is the given string.
fn push_many<S: Str>(&self, cs: &[S]) -> PosixPath
Returns a new path consisting of the path given by the given vector
of strings, relative to self
.
fn pop(&self) -> PosixPath
Identical to dir_path
except in the case where self
has only one
component. In this case, pop
returns the empty path.
fn unsafe_join(&self, other: &PosixPath) -> PosixPath
The same as push_rel
, except that the directory argument must not
contain directory separators in any of its components.
fn is_restricted(&self) -> bool
On Unix, always returns false
. On Windows, returns true
iff self
's
file stem is one of: con
aux
com1
com2
com3
com4
lpt1
lpt2
lpt3
prn
nul
.
fn normalize(&self) -> PosixPath
Returns a new path that names the same file as self
, without containing
any '.', '..', or empty components. On Windows, uppercases the drive letter
as well.
fn is_absolute(&self) -> bool
Returns true
if self
is an absolute path.
fn components<'a>(&'a self) -> &'a [~str]
impl FileSystemInfo for Path
fn get_path<'a>(&'a self) -> &'a Path
Get the filesystem path that this instance points at, whether it is valid or not. In this way, it can be used to to specify a path of a non-existent file which it later creates
impl FileInfo for Path
impl DirectoryInfo for Path
impl PathLike for Path
fn path_as_str<T>(&self, f: &fn(&str) -> T) -> T
Prefix searches with a type followed by a colon (e.g.
fn:
) to restrict the search to a given type.
Accepted types are: fn
, mod
,
struct
(or str
), enum
,
trait
, typedef
(or
tdef
).