| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263 |
- // 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")))]
- #[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!()
- }
- /// Lists the extended attributes. Follows symlinks like `metadata`
- pub fn list(_: &Path) -> io::IoResult<Vec<Attribute>> {
- Ok(Vec::new())
- }
- /// Lists the extended attributes. Does not follow symlinks like `symlink_metadata`
- 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;
- #[cfg(not(feature="git"))] use std::path::Path;
- #[cfg(not(feature="git"))] use file::fields;
- #[cfg(not(feature="git"))]
- impl Git {
- pub fn scan(_: &Path) -> Result<Git, ()> {
- Err(())
- }
- pub fn status(&self, _: &Path) -> fields::Git {
- panic!("Tried to access a Git repo without Git support!");
- }
- pub fn dir_status(&self, path: &Path) -> fields::Git {
- self.status(path)
- }
- }
|