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

Add smb_info to a scandir result #251

Merged
merged 1 commit into from
Nov 24, 2023
Merged

Add smb_info to a scandir result #251

merged 1 commit into from
Nov 24, 2023

Conversation

jborean93
Copy link
Owner

Adds the property smb_info to the scandir enumerated result which contains the already retrieved metadata on the file during the scan operation. This provides a more efficient way for callers to retrieve information like the file times, sizes, attributes straight away without having to call .stat() which results in another SMB request to the server.

Fixes: #250

Copy link

codecov bot commented Nov 24, 2023

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (eaf24fa) 99.05% compared to head (1d3c6b5) 99.06%.

Additional details and impacted files
@@           Coverage Diff           @@
##           master     #251   +/-   ##
=======================================
  Coverage   99.05%   99.06%           
=======================================
  Files          24       24           
  Lines        5097     5112   +15     
=======================================
+ Hits         5049     5064   +15     
  Misses         48       48           
Flag Coverage Δ
99.06% <100.00%> (+<0.01%) ⬆️
py3.10 99.02% <100.00%> (+<0.01%) ⬆️
py3.11 99.02% <100.00%> (+<0.01%) ⬆️
py3.12 99.02% <100.00%> (+<0.01%) ⬆️
py3.7 99.01% <100.00%> (+<0.01%) ⬆️
py3.8 99.02% <100.00%> (+<0.01%) ⬆️
py3.9 99.05% <100.00%> (+<0.01%) ⬆️
x64 99.06% <100.00%> (+<0.01%) ⬆️
x86 98.98% <100.00%> (+<0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Adds the property smb_info to the scandir enumerated result which
contains the already retrieved metadata on the file during the scan
operation. This provides a more efficient way for callers to retrieve
information like the file times, sizes, attributes straight away without
having to call .stat() which results in another SMB request to the
server.
@rikroe
Copy link

rikroe commented Nov 24, 2023

Thank you so much!

I was hoping you'd be fine with using the data and wanted to ask to create a PR for that, but you have been blazing fast!

I tested your PR code, it is working smoothly! And even faster on large files than ls -Al on a cifs mount 🔥 (~4:30min against ~10min for 280k files).

Copy link

@rikroe rikroe left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@jborean93
Copy link
Owner Author

I was hoping you'd be fine with using the data and wanted to ask to create a PR for that, but you have been blazing fast!

You just picked the right time to open the issue, I've been neglecting this library for a while now and needed to get back to it.

I tested your PR code, it is working smoothly! And even faster on large files than ls -Al on a cifs mount 🔥 (~4:30min against ~10min for 280k files).

Thanks for testing, I'm actually surprised it's faster than a cifs mount but always happen to see that there are some benefits here :)

@jborean93 jborean93 merged commit f5314fe into master Nov 24, 2023
29 checks passed
@jborean93 jborean93 deleted the scandir-info branch November 24, 2023 10:24
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 this pull request may close these issues.

Difference between SMBDirEntry._dir_info and .stat()
2 participants