-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Change file.info() to file.mtime(), file.size() #4346
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
base: main
Are you sure you want to change the base?
Conversation
…tra_cols = FALSE)
|
|
gadenbuie
left a comment
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.
Thank you!
I think we were using file.info() as an optimization, because file.size() and others call file.info() under the hood, but they also nicely incorporate the extra_cols = FALSE flag and after looking into it a little bit I think the performance benefit is negligible.
| # because native.enc is also normally UTF-8 based on *nix) | ||
| if (!isWindows()) return('UTF-8') | ||
| size <- file.info(file)[, 'size'] | ||
| size <- file.info(file, extra_cols = FALSE)[, 'size'] |
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.
| size <- file.info(file, extra_cols = FALSE)[, 'size'] | |
| size <- file.size(file) |
|
arghhh... i committed using my employment email address, and when i signed the CLA, github auto put my employment email address wrong, and now i can't re-sign the CLA... Is there something that maintainers can do to allow me to re-sign, and i'll put in the correct email address matching my commits? really really sorry about this... |
|
@klin333 thanks but don't worry about the CLA! We've switch Shiny to an MIT license and the CLA is less important now; we'll probably disable the CLA bot soon. And (not to diminish your contribution in any way), this PR isn't likely copyrightable anyway. |
|
thanks @gadenbuie. any chance you can help allow this merge through. it seems to be currently stuck at the licensing cla check. |
By default, file.info() has extra_cols = TRUE. This gets very annoying on Windows since R4.5.0, which added extra columns which sometimes can fail and give warnings.
All uses of file.info in shiny package does not need these extra columns anyway. So this PR changes file.info() to the R provided convenience functions of file.mtime(), file.size() and file.info(..., extra_cols = FALSE)