DOS Level Programming (findfirst function)

Hello everyone!
I did C/C++ programming in Borland C and TurboC 3.0 IDE. Now I am doing it in VS2010. But I tried a lot to find the function findfirst() in VS2010. but nothing is found against it. Also no suitable help is found on google.com regarding How to Run/use findfirst() in window VS2010.

Can any one write a program which display computer directories and folders, subfolder, files from specific drive.

Thanks in anticipation.

Regards

AliF Balouch
Why vs2010 and not vs2017?

Anyways can you describe what find first() does?
Edit: https://stackoverflow.com/questions/12034943/win32-select-directory-dialog-from-c-c
Last edited on
Can any one write a program which display computer directories and folders, subfolder, files from specific drive.


Sure. Open a windows command window and type
tree
or dir /b /s

if you want to do it in code, visual studio has calls to the OS that can do it. I haven't done it since before vs 2005 so I would have to dig through the web for what commands, but they exist.
Last edited on
But I tried a lot to find the function findfirst() in VS2010. but nothing is found against it. Also no suitable help is found on google.com regarding How to Run/use findfirst() in window VS2010.

This is one of the hazards of using a severely outdated compiler. However I did find a lot of information about this outdated function on the internet (almost a million results). Perhaps you need to up your research skills?
https://docs.microsoft.com/en-us/cpp/c-runtime-library/reference/findfirst-functions?view=vs-2017
and
https://docs.microsoft.com/en-us/windows/desktop/FileIO/listing-the-files-in-a-directory

There are probably much better API functions to use with modern windows but I'll let you have a go at this research.

Just a pedantic note... modern Windows is not (MS)DOS. MSDOS has not existed beyond Windows 95. Windows NT is not built on top of DOS.

The answer to "how to run/use findfirst()" is to not use it.

I, too, suggest looking at the link jlb provided, if you want to program for Windows and not MS-DOS.
https://docs.microsoft.com/en-us/windows/desktop/FileIO/listing-the-files-in-a-directory

______________________________________________________________

PS: C#'s API is even easier,
System.IO.Directory.GetFiles
System.IO.Directory.GetDirectories
https://stackoverflow.com/questions/14877237/getting-all-file-names-from-a-folder-using-c-sharp
Last edited on
MSDOS has not existed beyond Windows 95.
Just a minor nitpick. Windows 98 and ME were also based on DOS. It was only with 2000 and XP that DOS was completely abandoned and replaced by a 16-bit emulation layer.
NT 4 which became 2k I believe also cut dos out of the underneath layer?
Honestly the last commonly used dos was 6.X running win 3.X on top of it (there may have been some embedded computer versions after the home OS was dead). The hidden dos that was used to build 95 was there but not as accessible as before. 95 and pre service pack 98 were so bad I ran dos through most of those eras, and swapped to nt4 at some point.
Last edited on
Yes NT4 was the predecessor 2000. During this period there were two branches of Windows the NT series and the Win95 offshoots.

The hidden dos that was used to build 95 was there but not as accessible as before. 95 and pre service pack 98 were so bad I ran dos through most of those eras

I actually switched to OS2 until NT4 proved itself since OS2 was much more stable and the device driver availability were much better than NT3. The last Windows OS I used was Windows 2000, I switched to Linux instead of "upgrading" Windows any farther.

Topic archived. No new replies allowed.