pub fn tmpdir() -> Path {
    return lookup();

    fn getenv_nonempty(v: &str) -> Option<Path> {
        match getenv(v) {
            Some(x) =>
                if x.is_empty() {
                    None
                } else {
                    Some(Path(x))
                },
            _ => None
        }
    }

    #[cfg(unix)]
    #[allow(non_implicitly_copyable_typarams)]
    fn lookup() -> Path {
        getenv_nonempty("TMPDIR").get_or_default(Path("/tmp"))
    }

    #[cfg(windows)]
    #[allow(non_implicitly_copyable_typarams)]
    fn lookup() -> Path {
        getenv_nonempty("TMP").or(
            getenv_nonempty("TEMP").or(
                getenv_nonempty("USERPROFILE").or(
                   getenv_nonempty("WINDIR")))).get_or_default(Path("C:\\Windows"))
    }
}
/**
 * Returns the path to a temporary directory.
 *
 * On Unix, returns the value of the 'TMPDIR' environment variable if it is
 * set and non-empty and '/tmp' otherwise.
 *
 * On Windows, returns the value of, in order, the 'TMP', 'TEMP',
 * 'USERPROFILE' environment variable  if any are set and not the empty
 * string. Otherwise, tmpdir returns the path to the Windows directory.
 */
Returns the path to a temporary directory.
On Unix, returns the value of the 'TMPDIR' environment variable if it is
set and non-empty and '/tmp' otherwise.


Returns the path to a temporary directory . On Unix returns the value of the ' TMPDIR ' environment variable if it is set and non - empty and ' / tmp ' otherwise .
pub fn tmpdir() -> Path {
    return lookup();
    fn getenv_nonempty(v: &str) -> Option<Path> {
        match getenv(v) {
            Some(x) =>
                if x.is_empty() {
                    None
                } else {
                    Some(Path(x))
                },
            _ => None
        }
    }
    #[cfg(unix)]
    #[allow(non_implicitly_copyable_typarams)]
    fn lookup() -> Path {
        getenv_nonempty("TMPDIR").get_or_default(Path("/tmp"))
    }
    #[cfg(windows)]
    #[allow(non_implicitly_copyable_typarams)]
    fn lookup() -> Path {
        getenv_nonempty("TMP").or(
            getenv_nonempty("TEMP").or(
                getenv_nonempty("USERPROFILE").or(
                   getenv_nonempty("WINDIR")))).get_or_default(Path("C:\\Windows"))
    }
}
pub fn tmpdir ( ) -> Path { return lookup ( ) ; fn getenv_nonempty ( v : & str ) -> Option < Path > { match getenv ( v ) { Some ( x ) => if x . is_empty ( ) { None } else { Some ( Path ( x ) ) } , _ => None } } # [ cfg ( unix ) ] # [ allow ( non_implicitly_copyable_typarams ) ] fn lookup ( ) -> Path { getenv_nonempty ( " " ) . get_or_default ( Path ( " " ) ) } # [ cfg ( windows ) ] # [ allow ( non_implicitly_copyable_typarams ) ] fn lookup ( ) -> Path { getenv_nonempty ( " " ) . or ( getenv_nonempty ( " " ) . or ( getenv_nonempty ( " " ) . or ( getenv_nonempty ( " " ) ) ) ) . get_or_default ( Path ( " \\ " ) ) } }
Returns the path to a temporary directory.
Returns the path to a temporary directory .