Author |
Message |
Andy
|
Posted: Thu Apr 20, 2006 12:03 pm Post subject: directories |
|
|
any one know a way to list the contents of a directory into an array for windows? i'm using VC++ 6.0.
thanks |
|
|
|
|
![](images/spacer.gif) |
Sponsor Sponsor
![Sponsor Sponsor](templates/subSilver/images/ranks/stars_rank5.gif)
|
|
![](images/spacer.gif) |
Andy
|
Posted: Thu Apr 20, 2006 12:32 pm Post subject: (No subject) |
|
|
okay yeah i think i have a solution to my own problem...
according to my boss, there is a windows ddk function called FindFirstFile, also i could do a system call system("dir > *.dmp contents.txt") then parse that file and delete it at the end. |
|
|
|
|
![](images/spacer.gif) |
Mazer
![](http://compsci.ca/v3/uploads/user_avatars/1323750815476d9f446d80c.png)
|
Posted: Thu Apr 20, 2006 12:38 pm Post subject: (No subject) |
|
|
There's a solution. I wouldn't have thought to do that only because I'm so unfamiliar with the windows command line...
I'd probably still prefer to use some system call though. |
|
|
|
|
![](images/spacer.gif) |
Andy
|
Posted: Thu Apr 20, 2006 12:41 pm Post subject: (No subject) |
|
|
but creating a text file then parsing it is too much of an hassle... |
|
|
|
|
![](images/spacer.gif) |
Mazer
![](http://compsci.ca/v3/uploads/user_avatars/1323750815476d9f446d80c.png)
|
Posted: Thu Apr 20, 2006 3:51 pm Post subject: (No subject) |
|
|
Maybe you're being sarcastic, but I do agree with what you said. That's why I'd have recommended using some winapi or other external function (sorry, I probably shouldn't have used the term "system call"). They provide lots of functionality, and you won't be able to avoid them forever... if you wanted useful things built into the language you should try something else. Python, for instance, has functions in the os module somewhere that deals with directories.
sorry about dave, I couldn't resist |
|
|
|
|
![](images/spacer.gif) |
wtd
|
Posted: Thu Apr 20, 2006 4:17 pm Post subject: (No subject) |
|
|
Research the following fucntions.
FindFirstFile, FindFirstFileEx, FindNextFile, FindClose |
|
|
|
|
![](images/spacer.gif) |
md
![](http://compsci.ca/v3/uploads/user_avatars/1849317514ed6c4399768d.png)
|
Posted: Thu Apr 20, 2006 5:29 pm Post subject: (No subject) |
|
|
If your using system calls and temporary files then I don't wanna see your code... that's just plain wrong. MSDN is your friend for windows APIs... |
|
|
|
|
![](images/spacer.gif) |
wtd
|
|
|
|
![](images/spacer.gif) |
Sponsor Sponsor
![Sponsor Sponsor](templates/subSilver/images/ranks/stars_rank5.gif)
|
|
![](images/spacer.gif) |
Mazer
![](http://compsci.ca/v3/uploads/user_avatars/1323750815476d9f446d80c.png)
|
Posted: Thu Apr 20, 2006 7:53 pm Post subject: (No subject) |
|
|
Heh, Andy: ![Very Happy Very Happy](http://compsci.ca/v3/images/smiles/icon_biggrin.gif) |
|
|
|
|
![](images/spacer.gif) |
Andy
|
Posted: Fri Apr 21, 2006 10:39 am Post subject: (No subject) |
|
|
wtd, if you read my second post, i already stated that my boss gave me a solution. but thanks for your help anyways.
i encountered boost, but you had to include like 4 different headers.. i'm really bloody lazy, and this is just an OCA bucket collection tool, and since OCA is by microsoft, i dont need cross platform |
|
|
|
|
![](images/spacer.gif) |
wtd
|
Posted: Fri Apr 21, 2006 11:45 am Post subject: (No subject) |
|
|
Yeah. I saw that. I just thought I'd expand on it by offering a few additional function names to research. If nothing else I figured it'd make it easier to run searches for example code.
Oh, and don't discount Boost. You may not need it to be cross-platform, but Boost is likely also a great deal easier to use. |
|
|
|
|
![](images/spacer.gif) |
|