use fs::{self, Permissions, OpenOptions};
use io;
use libc;
-#[allow(deprecated)]
-use os::unix::raw;
use path::Path;
use sys;
use sys_common::{FromInner, AsInner, AsInnerMut};
use sys::platform::fs::MetadataExt as UnixMetadataExt;
-#[unstable(feature = "fs_mode", reason = "recently added API", issue = "27712")]
-#[rustc_deprecated(since = "1.7.0", reason = "moved to the libc crate instead")]
-#[allow(deprecated)]
-pub const USER_READ: raw::mode_t = 0o400;
-#[unstable(feature = "fs_mode", reason = "recently added API", issue = "27712")]
-#[rustc_deprecated(since = "1.7.0", reason = "moved to the libc crate instead")]
-#[allow(deprecated)]
-pub const USER_WRITE: raw::mode_t = 0o200;
-#[unstable(feature = "fs_mode", reason = "recently added API", issue = "27712")]
-#[rustc_deprecated(since = "1.7.0", reason = "moved to the libc crate instead")]
-#[allow(deprecated)]
-pub const USER_EXECUTE: raw::mode_t = 0o100;
-#[unstable(feature = "fs_mode", reason = "recently added API", issue = "27712")]
-#[rustc_deprecated(since = "1.7.0", reason = "moved to the libc crate instead")]
-#[allow(deprecated)]
-pub const USER_RWX: raw::mode_t = 0o700;
-#[unstable(feature = "fs_mode", reason = "recently added API", issue = "27712")]
-#[rustc_deprecated(since = "1.7.0", reason = "moved to the libc crate instead")]
-#[allow(deprecated)]
-pub const GROUP_READ: raw::mode_t = 0o040;
-#[unstable(feature = "fs_mode", reason = "recently added API", issue = "27712")]
-#[rustc_deprecated(since = "1.7.0", reason = "moved to the libc crate instead")]
-#[allow(deprecated)]
-pub const GROUP_WRITE: raw::mode_t = 0o020;
-#[unstable(feature = "fs_mode", reason = "recently added API", issue = "27712")]
-#[rustc_deprecated(since = "1.7.0", reason = "moved to the libc crate instead")]
-#[allow(deprecated)]
-pub const GROUP_EXECUTE: raw::mode_t = 0o010;
-#[unstable(feature = "fs_mode", reason = "recently added API", issue = "27712")]
-#[rustc_deprecated(since = "1.7.0", reason = "moved to the libc crate instead")]
-#[allow(deprecated)]
-pub const GROUP_RWX: raw::mode_t = 0o070;
-#[unstable(feature = "fs_mode", reason = "recently added API", issue = "27712")]
-#[rustc_deprecated(since = "1.7.0", reason = "moved to the libc crate instead")]
-#[allow(deprecated)]
-pub const OTHER_READ: raw::mode_t = 0o004;
-#[unstable(feature = "fs_mode", reason = "recently added API", issue = "27712")]
-#[rustc_deprecated(since = "1.7.0", reason = "moved to the libc crate instead")]
-#[allow(deprecated)]
-pub const OTHER_WRITE: raw::mode_t = 0o002;
-#[unstable(feature = "fs_mode", reason = "recently added API", issue = "27712")]
-#[rustc_deprecated(since = "1.7.0", reason = "moved to the libc crate instead")]
-#[allow(deprecated)]
-pub const OTHER_EXECUTE: raw::mode_t = 0o001;
-#[unstable(feature = "fs_mode", reason = "recently added API", issue = "27712")]
-#[rustc_deprecated(since = "1.7.0", reason = "moved to the libc crate instead")]
-#[allow(deprecated)]
-pub const OTHER_RWX: raw::mode_t = 0o007;
-#[unstable(feature = "fs_mode", reason = "recently added API", issue = "27712")]
-#[rustc_deprecated(since = "1.7.0", reason = "moved to the libc crate instead")]
-#[allow(deprecated)]
-pub const ALL_READ: raw::mode_t = 0o444;
-#[unstable(feature = "fs_mode", reason = "recently added API", issue = "27712")]
-#[rustc_deprecated(since = "1.7.0", reason = "moved to the libc crate instead")]
-#[allow(deprecated)]
-pub const ALL_WRITE: raw::mode_t = 0o222;
-#[unstable(feature = "fs_mode", reason = "recently added API", issue = "27712")]
-#[rustc_deprecated(since = "1.7.0", reason = "moved to the libc crate instead")]
-#[allow(deprecated)]
-pub const ALL_EXECUTE: raw::mode_t = 0o111;
-#[unstable(feature = "fs_mode", reason = "recently added API", issue = "27712")]
-#[rustc_deprecated(since = "1.7.0", reason = "moved to the libc crate instead")]
-#[allow(deprecated)]
-pub const ALL_RWX: raw::mode_t = 0o777;
-#[unstable(feature = "fs_mode", reason = "recently added API", issue = "27712")]
-#[rustc_deprecated(since = "1.7.0", reason = "moved to the libc crate instead")]
-#[allow(deprecated)]
-pub const SETUID: raw::mode_t = 0o4000;
-#[unstable(feature = "fs_mode", reason = "recently added API", issue = "27712")]
-#[rustc_deprecated(since = "1.7.0", reason = "moved to the libc crate instead")]
-#[allow(deprecated)]
-pub const SETGID: raw::mode_t = 0o2000;
-#[unstable(feature = "fs_mode", reason = "recently added API", issue = "27712")]
-#[rustc_deprecated(since = "1.7.0", reason = "moved to the libc crate instead")]
-#[allow(deprecated)]
-pub const STICKY_BIT: raw::mode_t = 0o1000;
-
/// Unix-specific extensions to `Permissions`
#[stable(feature = "fs_ext", since = "1.1.0")]
pub trait PermissionsExt {