CURLSMBS Progress Event

When I use CURLSMBS to download a file using SFTP, the various arguments to the Progress event (percent, dlnow, dltotal) hold useful values. When I download a directory listing, however, these values are always 0. My app needs to download very large directory listings and I’d like to be able to display an informative progress bar. Is this a limitation of the MBS CURLS implementation, or of CURLS itself?

In a related question, is it possible to download a directory listing one line at a time? If this were the case then I wouldn’t need to download the whole thing in most cases.

Just a guess, but I doubt whether the directory listing data (vs. an actual file transfer) fires the Progress event at all. If you’re not already, you might set the progress bar to Indeterminate for this part.

It does fire, but with all arguments = 0, as I stated.

I am using an indeterminate progress bar, since the progress data of the event isn’t allowing a quantitative display, but I’d like to have a quantitative progress indication, hence my post.

Yes, I was mistaken to suggest that the data itself “fires” the event. As I understand, the Progress event fires once per second. What I’m doubtful of is whether directory listing data are passed to its parameters.

The only difference at my end between downloading a file and downloading a directory listing is whether or not the URL ends with a “/”; I don’t know where in the bowels of the FTP protocol and/or CURL other differences become significant.

@Christian_Schmitz any ideas about this? The official CURL documentation doesn’t seem to say that progress for a directory listing is different from that of a file transfer.

Look into the ChunkBegin and ChunkEnd events. These are used for FTP wildcard operations/directory listings. I think they also are used with SFTP.

1 Like

ChunkBegin and ChunkEnd don’t fire for me, but inspired by your suggestion I see that Write does fire with valid data - at least I can show the number of bytes received, even if I don’t know the percentage of total expected.

Well, directory listings via SFTP are not really a download, it goes down a different path.

And the code looks like it just continues to ask for next entry until it gets the done message, so no progress reporting.