I'm trying to make a little disk cleaner program and I couldn't figure out how to display the results of scanned directory on list view tool on windows form application. I have a 3 columns and these are File Name, Folder Path and File Size. I want the program to scan for example this location: C:\Users\Emre\AppData\Local\CrashDumps and display all of the files in that location on the list view tool. How could i do this? And how do display the file size and file location on the next 2 colomns and these other two colomns are sub items.

Thank you!

Recommended Answers

All 3 Replies

The header you're looking for is <dirent.h> , which allows you to use the opendir() function. That function opens a specific folder and allows you to iterate through all the files in that folder and view their names and sizes. If you look up tutorials on using that library, you'll find what you need.

That is for .net right? I'm using windows form applications and I need to display these files on a list view tool

You don't need .NET to use <dirent.h> . It's part of the standard C library.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.