Creates a file that points to the current working directory.
impl File {
fn current_dir() -> File
}Returns a file that points to the current working directory.
This call does not actually open a directory. The returned File is thus affected by changes of the global current working directory via lrs::process::set_cwd . If you require a pointer to the current directory that is not affected by changes to the current working directory of the process, use the following code:
let file = try!(File::open(".", FILE_PATH);This call is mostly useful when working with interfaces that require an argument which points to a directory. For example, File::open is implemented like this:
pub fn open_read<P>(path: P) -> Result<File>
where P: ToCString,
{
File::current_dir().rel_open_read(path)
}