-
Notifications
You must be signed in to change notification settings - Fork 75
Absolute file URLs on Windows #60
Comments
Can you share your code? I've tested on Windows 10 but cannot reproduce this issue. |
Here's a demo application: https://github.com/anlumo/zboxurls Here's the output on my machine:
|
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 For example, the required URI is like: 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"); |
According to Wikipedia, this is not correct. It explicitly states that the third slash is required there. However, I noticed that your API accepts |
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. |
I'm able to use the file storage on Windows 10 using urls like
file://../data/foo
, butfile://D:/data/foo
fails on theopen
call with the following error message:I'm generating the file URLs using Url::from_file_path, so the syntax should be ok. I can also paste this URL into Chrome and opens the folder view.
The text was updated successfully, but these errors were encountered: