Comments (5)
Can you share your code? I've tested on Windows 10 but cannot reproduce this issue.
from zbox.
Here's a demo application: https://github.com/anlumo/zboxurls
Here's the output on my machine:
D:\zboxurls> cargo run
Finished dev [unoptimized + debuginfo] target(s) in 0.15s
Running `target\debug\zboxurls.exe`
Opening URL: file:///D:/zboxurls/target/debug/test-fs
thread 'main' panicked at 'opening archive failed: Io(Os { code: 123, kind: Other, message: "The filename, directory name, or volume label syntax is incorrect." })', src\libcore\result.rs:1189:5
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace.
error: process didn't exit successfully: `target\debug\zboxurls.exe` (exit code: 101)
from zbox.
Thanks @anlumo . The reason is that url generated by Url::from_file_path is not compatible with ZboxFS URI format, which requires an OS path after file://
.
For example, the required URI is like: file://C:/Users/foo bar/dir
, but the URI generated by Url::from_file_path
is like: file:///C:/Users/foo%20bar/dir
.
A quick solution might be converting the url back to path using url.to_file_path.
let url = Url::from_file_path(&path).unwrap();
RepoOpener::new()
.create_new(true)
.open(&format!("file://{}", url.to_file_path().unwrap().display()), "abcdef")
.expect("opening archive failed");
from zbox.
According to Wikipedia, this is not correct. It explicitly states that the third slash is required there.
However, I noticed that your API accepts file://D:\zboxurls\target\debug\test-fs
as the URL, which is horrible, but at least I can get it to work now…
from zbox.
The URI used in ZboxFS is not same as the standard URI or URL, it is different according to different storage. For file storage, it looks like an URL but actually not, it is just an identifier points to a path on OS. Anyway, I will update the doc to make it more clear.
from zbox.
Related Issues (20)
- Zbox storage needs destroy method
- RepoInfo.uri() should not mask secretive data
- Is zbox secure agains storage file tampering? HOT 3
- Confusing abort if omit zbox::init_env HOT 7
- zbox::Error is not accessible from within std::io::Error HOT 1
- Stress-testing multiple reads, writes and seeks produces an unreadable file (IO error: File not found)
- Problems when `file://` storage runs out of space HOT 42
- Panic when writing to `Mutex<zbox::File>` from multiple threads. HOT 1
- Panic when trying to write a file after interrupted previous attempt. HOT 1
- FR: `zbox::Repo::ongoing_transaction` HOT 5
- Is zbox::Repo::rename atomic? HOT 1
- Add dedup file option when creating repo
- RepoInfo lack of dedup_file entry
- Snapshots? HOT 2
- Failed open repo in file mode
- Question: reason not support symbolic link?
- storage-sqlite RepoOpener not creating path
- Future plans and continuation HOT 1
- Python support
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from zbox.