dutchcoders / dutchcoders/goftp
Possible to view progress of download?
- Dominant language
- Go
- Stars
- 280
- Forks
- 94
- PR merge metrics
- No merged PRs in 30d
Description
I am attempting to pull down a fairly large file (2 GB).
I took your example and added some logging:
```
_, err = ftp.Retr(path, func(r io.Reader) error {
var hasher = sha256.New()
fmt.Println("Call copy")
if _, err = io.Copy(hasher, r); err != nil {
return err
}
fmt.Println("after copy")
hash := fmt.Sprintf("%s %x", path, hex.EncodeToString(hasher.Sum(nil)))
fmt.Println(hash)
return nil
```
But after it logs "Call copy" it sits for quite a while. I assume this is because the file is actually downloading at this point.
I'm wondering if my assumption is correct? If so - is there any way that I can display the download progress periodically while the file is downloading?
Contributor guide
No contributing guide indexed for this repository
Research direction
Start with the ftp.Retr example and the callback around io.Copy shown in the issue, then read the related Retr implementation and documentation. Determine whether the download can expose periodic progress during the callback, and consider the work complete when the supported approach is documented or the requested progress capability is clearly addressed.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- go
- Domain
- networking
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 38/100