Skip to content

Understanding provider.Walk #21

Answered by mouuff
mcorossigo asked this question in Q&A
Discussion options

You must be logged in to vote

Hello,
Thank you for your interest in this project!

Can you explain the reasoning behind the Walk function?
The walk method provides a way to iterate the files that can be retrieved from the provider.
To call the walk method you must pass a func(info *FileInfo) error which will be called for each file, giving information about each file.
(Currently just path and mode)
FYI the path in FileInfo is relative to the provider, it is not a system path (for example: just /something.exe, then you can call retrieve on /something.exe if you want)

it appears to always fallback to the local provider walk
You are right, very often we just call the local provider. This is because most providers at the m…

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by mouuff
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants