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

Refreshing file information #1445

Closed
miki2119 opened this issue Sep 26, 2023 · 2 comments · Fixed by #1667
Closed

Refreshing file information #1445

miki2119 opened this issue Sep 26, 2023 · 2 comments · Fixed by #1667

Comments

@miki2119
Copy link

There are currently a number of issues that become most visible when the period function is used to refresh file information, but that also affect different lf functions regardless.

Examples are: #1417 #1172 #1226 #776

The issues can be categorized as follows:

  • an internal function makes file changes that are not correctly updated
  • an external process makes file changes that are not correctly updated

I would like to use this issue to discuss possible solutions

To address changes done by internal functions, we could introduce some kind of forceload command to be executed after things like copying files in order to manually refresh the file information that may have changed.

To address external changes, we would need to check for file changes periodically, which needs to be efficient to avoid increased load.

The load function that is also periodically run by the period feature, only checks for modifications of the current directory and ignores changes to files.

Instead of checking the mtime of directories in the checkDir() function, we could check all files in the currently selected pane. This could be limited to the currently listed files to avoid increased loads in case of large directories. Using ctime instead would also catch metadata changes like permissions.

@miki2119
Copy link
Author

Note that as far as I understand, ranger uses both a triggered refresh after functions like copy files as well as a periodic refresh of all files that are displayed.

@miki2119
Copy link
Author

This is a first attempt to implement a check for file changes in addition to the existing one for directories
miki2119@38665c4

The good news is that is works and solves all linked bugs, but as expected there is a noticeable impact on execution time.
Any feedback or suggestions for better performance?

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

Successfully merging a pull request may close this issue.

1 participant