Sometimes i get newlines on every update
faulander opened this issue · comments
Running on Windows 10, 64bit with Nim 1.2.0
Code:
for dir in walkDirRec(sourceDir, yieldFilter={pcDir}): #traverse all dirs in source path
var amountOfFilesInDir = countFiles(dir, @[".jpg", ".jpeg"])
var bar = newProgressBar(amountOfFilesInDir)
echo "Processing Directory ", dir, " with ", intToStr(amountOfFilesInDir), " files."
bar.start()
for file in walkDirRec(dir, yieldFilter={pcFile}): # traverse all files in dir
deleted = delUnwantedFiles(file)
if (find(toLower(file), ".jpg") > 0 or find(toLower(file), ".jpeg") > 0) and deleted == false:
#var details = getFileDetails(file)
var resultOfResize = resizeImage(file, 60)
bar.increment()
bar.finish()
That’s odd, I’m not sure what would cause that, but will test it and see if I can find a reason.
…On Mon, 13 Apr 2020, at 15:47, faulander wrote:
[*********>...........................................................................................................................................] 10.59%[**********>..........................................................................................................................................] 11.76%[***********>........................................................................................................................................] 12.94%[***********>......................................................................................................................................] 14.12%[************>....................................................................................................................................] 15.29%[******************>..................................................................................................................................] 16.47%
Code:
`for dir in walkDirRec(sourceDir, yieldFilter={pcDir}): #traverse all
dirs in source path
var amountOfFilesInDir = countFiles(dir, @[".jpg", ".jpeg"])
var bar = newProgressBar(amountOfFilesInDir)
echo "Processing Directory ", dir, " with ",
intToStr(amountOfFilesInDir), " files."
bar.start()
for file in walkDirRec(dir, yieldFilter={pcFile}): # traverse all
files in dir
deleted = delUnwantedFiles(file)
if (find(toLower(file), ".jpg") > 0 or find(toLower(file), ".jpeg")
> 0) and deleted == false:
#var details = getFileDetails(file)
var resultOfResize = resizeImage(file, 60)
bar.increment()
bar.finish()
`
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#4>, or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAFW24MNHUP666QGOXZLYTLRMMQXFANCNFSM4MHABZRQ>.
I checked the sourcecode and couldn't find the issue. It might be the flush command not correctly working on windows. i'll try and run it on a *nix shell and give you feedback.
I created a pull requests with a fix that works for me on windows AND Linux.
Thanks, I'll test today to make sure it works for me, then merge and tag a new release.