F
Fred H
Hi
I've tried to find out if and how I can open
directories in standard C++, the same way I
can open files. To my great suprise, I haven't
managed to find out how this is done!
I'm using MS VC++ 6.0, so I know I could
use some Win specific classes, but I was
hoping to write portable code, and hence
I'm looking for some way of "opening" a
directory that's not platform or file system
dependant, since this code eventually will
be running on both Windows and Linux PCs.
So does such functions exist?
What I want to accomplish, is to be able to
make a very crude "file browser", that can
take some "root directory", and read its
subdirectories into a vector or something.
Then I can print a simple menu with "hit 1
to enter mydir", and so on. And when you've
entered the desired directory, you can display
files of some predefined extention, and run
them by hitting the appropriate menu item.
What it's all for? Feeding scripts to a test
bench. I'm writing a testbench for a hardware
design.
Any inputs would be greatly appreaciated.
Cheers
-Fred
I've tried to find out if and how I can open
directories in standard C++, the same way I
can open files. To my great suprise, I haven't
managed to find out how this is done!
I'm using MS VC++ 6.0, so I know I could
use some Win specific classes, but I was
hoping to write portable code, and hence
I'm looking for some way of "opening" a
directory that's not platform or file system
dependant, since this code eventually will
be running on both Windows and Linux PCs.
So does such functions exist?
What I want to accomplish, is to be able to
make a very crude "file browser", that can
take some "root directory", and read its
subdirectories into a vector or something.
Then I can print a simple menu with "hit 1
to enter mydir", and so on. And when you've
entered the desired directory, you can display
files of some predefined extention, and run
them by hitting the appropriate menu item.
What it's all for? Feeding scripts to a test
bench. I'm writing a testbench for a hardware
design.
Any inputs would be greatly appreaciated.
Cheers
-Fred