pub fn copy_to_file<P: AsRef<Path>>(&self, path: P, option: CompactionOption) -> Result<File> {
        let file = File::create(&path)?;
        let fd = get_file_fd(&file);

        unsafe {
            self.copy_to_fd(fd, option)?;
        }

        // We reopen the file to make sure the cursor is at the start,
        // even a seek to start doesn't work properly.
        let file = File::open(path)?;

        Ok(file)
    }
/// Copy the environnement to the file at the given path, creating
/// and truncating the file if already exist.
///
/// Returns the created `File` with the content of the environnement.
Copy the environnement to the file at the given path, creating
and truncating the file if already exist.

Returns the created `File` with the content of the environnement.
Copy the environnement to the file at the given path creating and truncating the file if already exist . Returns the created ` File ` with the content of the environnement .
pub fn copy_to_file<P: AsRef<Path>>(&self, path: P, option: CompactionOption) -> Result<File> {
        let file = File::create(&path)?;
        let fd = get_file_fd(&file);
        unsafe {
            self.copy_to_fd(fd, option)?;
        }
        // We reopen the file to make sure the cursor is at the start,
        // even a seek to start doesn't work properly.
        let file = File::open(path)?;
        Ok(file)
    }
pub fn copy_to_file < P : AsRef < Path > > ( & self , path : P , option : CompactionOption ) -> Result < File > { let file = File :: create ( & path ) ? ; let fd = get_file_fd ( & file ) ; unsafe { self . copy_to_fd ( fd , option ) ? ; } // We reopen the file to make sure the cursor is at the start, // even a seek to start doesn't work properly. let file = File :: open ( path ) ? ; Ok ( file ) }
Copy the environnement to the file at the given path, creating
and truncating the file if already exist.
Copy the environnement to the file at the given path creating and truncating the file if already exist .
&self
path
P
option
CompactionOption
&self
path
P
option
CompactionOption