fn open(path: String) -> io::Result<AppendOnlyFile> {
		let file = OpenOptions::new()
			.read(true)
			.append(true)
			.create(true)
			.open(path.clone())?;
		let mut aof = AppendOnlyFile {
			path: path.clone(),
			file: file,
			mmap: None,
		};
		if let Ok(sz) = aof.size() {
			if sz > 0 {
				aof.sync()?;
			}
		}
		Ok(aof)
	}
/// Open a file (existing or not) as append-only, backed by a mmap.
Open a file (existing or not) as append-only, backed by a mmap.
Open a file ( existing or not ) as append - only backed by a mmap .
fn open(path: String) -> io::Result<AppendOnlyFile> {
		let file = OpenOptions::new()
			.read(true)
			.append(true)
			.create(true)
			.open(path.clone())?;
		let mut aof = AppendOnlyFile {
			path: path.clone(),
			file: file,
			mmap: None,
		};
		if let Ok(sz) = aof.size() {
			if sz > 0 {
				aof.sync()?;
			}
		}
		Ok(aof)
	}
fn open ( path : String ) -> io :: Result < AppendOnlyFile > { let file = OpenOptions :: new ( ) . read ( true ) . append ( true ) . create ( true ) . open ( path . clone ( ) ) ? ; let mut aof = AppendOnlyFile { path : path . clone ( ) , file : file , mmap : None , } ; if let Ok ( sz ) = aof . size ( ) { if sz > 0 { aof . sync ( ) ? ; } } Ok ( aof ) }
Open a file (existing or not) as append-only, backed by a mmap.
Open a file ( existing or not ) as append - only backed by a mmap .
path
String