-
-
Notifications
You must be signed in to change notification settings - Fork 56
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
Use generic for file loading in FileMiddleware #405
Conversation
This will allow for writing custom file loaders that cache file contents or use another source than the local file system for files
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I like the symbol names a lot, but want to check if the FileProvider
protocol has all the functions we would need
size: numericCast(lstat.st_size), | ||
modificationDate: Date(timeIntervalSince1970: modificationDate) | ||
) | ||
} catch { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there a known error that would be thrown if the file does not exist?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's a NIOCore.IOError(2)
but this could change when we move to NIOFileSystem.
Yeah that is a concern. The FileMiddleware covers pretty much all eventualities. The main possibility would be we need another file attribute. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Only one change, then it's fine
This will allow for writing custom file loaders that cache file contents or use another source than the local file system for files