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

SystemFile Cached Properties and Refresh #30

Closed
HEIC-to-JPEG-Dev opened this issue Mar 26, 2023 · 1 comment
Closed

SystemFile Cached Properties and Refresh #30

HEIC-to-JPEG-Dev opened this issue Mar 26, 2023 · 1 comment

Comments

@HEIC-to-JPEG-Dev
Copy link

Issue
There are currently no File properties

Proposal
Properties have yet to be implemented, but when they are, the following principles should be adopted.

  1. They are cached when possible;
  2. Implement Refresh and RefreshAsync to populate the core properties in a single method (same as FileInfo)
  3. For properties that are not cached and require disk IO (Exists, Attributes, Dates, etc.) they should call Refresh or RefreshAsync to allow multiple properties to be updated in a single call

Options
SystemFile is a "live" view of the file. In this scenario, any call to a property will get the latest update from disk (Attributes, Exists, etc.); this will require those properties to be Async.

Options
Two properties of each type where disk IO is required, for example "Exists" and "ExistsAsync", one uses cached results, one is direct to disk. this gives the developer the option to choose.

@Arlodotexe
Copy link
Owner

Arlodotexe commented Mar 31, 2023

This storage abstraction aims to create a single API surface that every file system can implement.

To make that easy and efficient for everyone (implementors, consumers, maintainers), we:

  • Implement the standardized interfaces
  • Expose a way to manipulate the file directly, via the underlying implementation.

If the consumer is able to instantiate or type check for a certain storage implementation, they must also have access to the underlying library that the implementation uses.

For example:

and so on. Because of that (and as explained in other participating issues), we won't be adding these to SystemFile directly.


However, these are great notes for #23. Our current API surface implies that properties are kept always update-to date. Since they are retrieved by an async method, implementations can use that set up property updates if it's supported. If it's not supported, the event just never fires.

This setup handles a lot of important things implicitly, but it does not handle opting out of these events. @HEIC-to-JPEG-Dev Mentioning the RefreshAsync method gave me an idea, let's move this to #23.

@Arlodotexe Arlodotexe closed this as not planned Won't fix, can't repro, duplicate, stale Mar 31, 2023
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