Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

No docs for the crate? #8

Closed
Jamzy01 opened this issue Jan 22, 2024 · 4 comments
Closed

No docs for the crate? #8

Jamzy01 opened this issue Jan 22, 2024 · 4 comments

Comments

@Jamzy01
Copy link

Jamzy01 commented Jan 22, 2024

According to docs.rs, the documentation failed to build for the crate. I really don't think I'd be able to use the crate without easily accessible documentation. Any idea why it failed to build?

@WolverinDEV
Copy link
Owner

Hey,
lovely you stumbled across this project.

Yes, the docs currently seem unable to build:

[INFO] [stderr] error[E0433]: failed to resolve: could not find `windows` in `os`
[INFO] [stderr]   --> src/source.rs:47:22
[INFO] [stderr]    |
[INFO] [stderr] 47 |         use std::os::windows::fs::MetadataExt;
[INFO] [stderr]    |                      ^^^^^^^ could not find `windows` in `os`
[INFO] [stderr] 
[INFO] [stderr] error[E0433]: failed to resolve: could not find `windows` in `os`
[INFO] [stderr]    --> src/fs.rs:295:13
[INFO] [stderr]     |
[INFO] [stderr] 295 |         os::windows::ffi::OsStringExt,
[INFO] [stderr]     |             ^^^^^^^ could not find `windows` in `os`
[INFO] [stderr] 
[INFO] [stderr] error[E0433]: failed to resolve: could not find `windows` in `os`
[INFO] [stderr]  --> src/callback_data.rs:3:9
[INFO] [stderr]   |
[INFO] [stderr] 3 |     os::windows::ffi::OsStringExt,
[INFO] [stderr]   |         ^^^^^^^ could not find `windows` in `os`

But as far as the docs go, the best is to have a look at the examples as most of the code hasn't been documented yet:
https://github.com/WolverinDEV/windows-projfs/tree/master/examples

Originally I create this project for usage in a backup-tool called conserve (sourcefrog/conserve#240).
May I ask how you stumbled across this project and what your use case would be?

@WolverinDEV
Copy link
Owner

Docs are building now:
https://docs.rs/windows-projfs/0.1.7/windows_projfs/

I created a new issue for generally improving the documentation:
#10

@Jamzy01
Copy link
Author

Jamzy01 commented Jan 22, 2024

May I ask how you stumbled across this project and what your use case would be?

I've been using the projfs crate in my project for a while now, but just today I realized that a better alternative has been created. Right now, I'm in the process of converting all my code over to use your library. The projfs crate I've been using is very low level and complicated, lacking in features (like receiving notifications about files), additionally it hasn't been updated in 4 years which is never a good sign. I'm currently making a file explorer like app using tauri, but my problem is that some of the file systems in my app (such as cloud file systems) don't physically exist on any local drive. It's not a problem within my app of course, but if the user wants to open up a cloud file in a native application, they can't do it unless there is a "physical" file on the drive.

I was also wondering if you knew whether listening to file write calls is possible in projected file systems? I was reading this stack overflow page and it looks like write calls can't be intercepted by the proj fs api, but once the file is opened and read from it becomes a "real file". Then maybe I can use the notify crate to listen to changes.

@WolverinDEV
Copy link
Owner

I've seen the projfs crate as well but it lacks basic features and actually has some bugs...

As a side note, regarding cloud file systems:
Windows has a dedicated API for cloud file systems documented here which might be better suited.

ProjFS is designed for use with high-speed backing data stores. One of its design goals is to make the projected data appear as if it were locally present, hiding the fact that the data may be remote. As such, ProjFS doesn't provide: mechanisms for reporting progress of data recall; indication of the online versus offline state of a file; nor other features that may be desirable when working with backing data stores that are slow. For such scenarios, consider instead using the Cloud Files API.

Source: https://learn.microsoft.com/en-us/windows/win32/projfs/projected-file-system
 
 

I was also wondering if you knew whether listening to file write calls is possible in projected file systems? I was reading this stack overflow page and it looks like write calls can't be intercepted by the proj fs api, but once the file is opened and read from it becomes a "real file". Then maybe I can use the notify crate to listen to changes.

You can not directly "monitor" write calls by using the projfs API but you can use the FileClosed notification.
This notification will occur every time a file handle to a projected file has been closed.
Additionally you can check the FileCloseAction to detect whenever a modification has been made.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants