You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Nov 8, 2023. It is now read-only.
thread 'main' panicked at 'failed to open repo: InvalidUri', src/main.rs:14:10
externcrate zbox;use std::io::{Read,Write,Seek,SeekFrom};use zbox::{init_env,RepoOpener,OpenOptions};fnmain(){// initialise zbox environment, called firstinit_env();// create and open a repository in current OS directoryletmut repo = RepoOpener::new().create(true).open("file://./my_repo","your password").expect("failed to open repo");// create and open a file in repository for writingletmut file = OpenOptions::new().create(true).open(&mut repo,"/my_file.txt").unwrap();// use std::io::Write trait to write data into it
file.write_all(b"Hello, World!").unwrap();// finish writing to make a permanent content version
file.finish().unwrap();// read file content using std::io::Read traitletmut content = String::new();
file.seek(SeekFrom::Start(0)).unwrap();
file.read_to_string(&mut content).unwrap();assert_eq!(content,"Hello, World!");}
[package]
name = "zbox-try"version = "0.1.0"edition = "2021"# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[dependencies]
zbox = "0.9.2"
Versions:
uname -a
Darwin Eren-MacBook-Air.local 21.5.0 Darwin Kernel Version 21.5.0: Tue Apr 26 21:08:29 PDT 2022; root:xnu-8020.121.3~4/RELEASE_ARM64_T8101 arm64
-
cargo -V
cargo 1.60.0-nightly (25fcb135d 2022-02-01)
-
rustc --version
rustc 1.60.0-nightly (f624427f8 2022-02-06)
The text was updated successfully, but these errors were encountered:
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Errors:
Versions:
The text was updated successfully, but these errors were encountered: