-
Currently, I’m counting the number of lines in my input stream (by counting the number of I would prefer to track progress with the number of bytes read by the |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 3 replies
-
The way that I've done this before is to use a wrapper stream that counts the bytes passing through it. It works well, but only works for streams where the length is known. If the length of the stream is unknown, then I don't see a way to report progress without buffering the entire file somewhere. Here is an example: |
Beta Was this translation helpful? Give feedback.
The way that I've done this before is to use a wrapper stream that counts the bytes passing through it. It works well, but only works for streams where the length is known. If the length of the stream is unknown, then I don't see a way to report progress without buffering the entire file somewhere.
Here is an example:
https://github.com/dataplat/dbatools/pull/8393/files
That example is using the lumenworks CSV parser, but the construction would be the same for my library. Specifically, see the ProgressStream.cs and Import-DbaCsv.ps1 files.