This website uses cookies. By clicking Accept, you consent to the use of cookies. Click Here to learn more about how we use cookies.
Turn on suggestions
Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.
- Revenera Community
- :
- InstallShield
- :
- InstallShield Forum
- :
- Re: InstallScript Help - Traversing directory tree and getting file list gives duplicates
Subscribe
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Subscribe
- Mute
- Printer Friendly Page
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Aug 03, 2017
03:07 PM
InstallScript Help - Traversing directory tree and getting file list gives duplicates
I'm trying to get the size of a large folder - 17.1 GB. The folder has 53 subfolders and 386 files. To begin with, I'm trying to traverse the directory tree and get the file sizes of each of the files. Currently, I'm just writing the information to a file for troubleshooting. The problem is that it is going back and traversing some folders again, and I can't figure out why!!! The results should show that there are 53 folders and 386 files. Instead it gets 53 folders and 1057 files. Can anyone see what is wrong with the FindAllFiles loop in the script attached?
(3) Replies
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Aug 03, 2017
04:31 PM
I think I found the answer. Some of the subfolders are parent folders, that don't have files, but they have more subfolders. I was able to get the right list of files by first gathering a list of only directories that had actual files in them. It's dumb, but adding the attached changes worked. (Attachment doesn't include the variable declarations, etc)
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Aug 05, 2017
04:24 AM
Here is another sample:
Get Size of All Files in a Directory:
http://www.installsite.org/files/GetDirFileSize.zip
from this site:
http://www.installsite.org/pages/en/isp_comp.htm
regards
Markus
Get Size of All Files in a Directory:
http://www.installsite.org/files/GetDirFileSize.zip
from this site:
http://www.installsite.org/pages/en/isp_comp.htm
regards
Markus
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Aug 08, 2017
11:22 AM
Thank you for checking into this and replying.
![](/skins/images/D60DF682EA37BF37032955CE10F3F0BB/responsive_peak/images/icon_anonymous_message.png)