2015-03-26 00:37:12 +00:00
|
|
|
// Extended attribute support
|
|
|
|
|
|
|
|
#[cfg(target_os = "macos")] mod xattr_darwin;
|
|
|
|
#[cfg(target_os = "macos")] pub use self::xattr_darwin::Attribute;
|
|
|
|
|
|
|
|
#[cfg(target_os = "linux")] mod xattr_linux;
|
|
|
|
#[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")))]
|
2015-06-08 20:33:39 +00:00
|
|
|
|
|
|
|
|
2015-03-26 00:37:12 +00:00
|
|
|
#[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!()
|
|
|
|
}
|
|
|
|
|
2015-05-16 17:16:35 +00:00
|
|
|
/// Lists the extended attributes. Follows symlinks like `metadata`
|
2015-03-26 00:37:12 +00:00
|
|
|
pub fn list(_: &Path) -> io::IoResult<Vec<Attribute>> {
|
|
|
|
Ok(Vec::new())
|
|
|
|
}
|
|
|
|
|
2015-05-16 17:16:35 +00:00
|
|
|
/// Lists the extended attributes. Does not follow symlinks like `symlink_metadata`
|
2015-03-26 00:37:12 +00:00
|
|
|
pub fn llist(_: &Path) -> io::IoResult<Vec<Attribute>> {
|
|
|
|
Ok(Vec::new())
|
|
|
|
}
|
|
|
|
|
|
|
|
pub fn feature_implemented() -> bool { false }
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// Git support
|
|
|
|
|
|
|
|
#[cfg(feature="git")] mod git;
|
|
|
|
#[cfg(feature="git")] pub use self::git::Git;
|
|
|
|
|
|
|
|
#[cfg(not(feature="git"))] pub struct Git;
|
2015-05-24 10:05:44 +00:00
|
|
|
#[cfg(not(feature="git"))] use std::path::Path;
|
|
|
|
#[cfg(not(feature="git"))] use file::fields;
|
2015-06-08 20:33:39 +00:00
|
|
|
|
2015-03-26 00:37:12 +00:00
|
|
|
#[cfg(not(feature="git"))]
|
|
|
|
impl Git {
|
|
|
|
pub fn scan(_: &Path) -> Result<Git, ()> {
|
|
|
|
Err(())
|
|
|
|
}
|
|
|
|
|
2015-05-24 10:05:44 +00:00
|
|
|
pub fn status(&self, _: &Path) -> fields::Git {
|
2015-03-26 00:37:12 +00:00
|
|
|
panic!("Tried to access a Git repo without Git support!");
|
|
|
|
}
|
|
|
|
|
2015-05-24 10:05:44 +00:00
|
|
|
pub fn dir_status(&self, path: &Path) -> fields::Git {
|
2015-03-26 00:37:12 +00:00
|
|
|
self.status(path)
|
|
|
|
}
|
|
|
|
}
|