![]() |
| | #1 |
| Registered User Join Date: Oct 2008
Posts: 10
| How to extract a list of files in a specific directory? I've started work on a small training project, which basicaly goes like this: You choose a directory and the program populates a list of files IN that directory along with the "Last modified" date. It, basicaly, works like the dir command in the command prompt. While I've got the little details sorted out I've got no clue or an intelligent guess of where to start with the files list. I don't know how to extract the first file name, how to get a number of files in that directory, how to cycle the file names, if that's possible - in what order will I get the names. And so on... I just need a heap of characters representing the file names (pats would be great too) stored in an accesible format. An explanation would be nice, a point in the right direction (internet tutorial, Borland C++ 5 Builder Help index etc.) would be equaly nice and appreaciated. |
| Perspektyva is offline | |
| | #2 |
| Kernel hacker Join Date: Jul 2007 Location: Farncombe, Surrey, England
Posts: 15,686
| There is a FAQ entry for "how do I list files in a directory" or some closely resembling subject. -- Mats
__________________ Compilers can produce warnings - make the compiler programmers happy: Use them! Please don't PM me for help - and no, I don't do help over instant messengers. |
| matsp is offline | |
| | #3 |
| Registered User Join Date: Oct 2008
Posts: 10
| Can't... seem to find it... |
| Perspektyva is offline | |
| | #4 |
| and the hat of vanishing Join Date: Aug 2001 Location: The edge of the known universe
Posts: 21,214
|
__________________ If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut. Up to 8Mb PlusNet broadband from only £5.99 a month! |
| Salem is offline | |
| | #5 |
| Registered User Join Date: Oct 2008
Posts: 10
| Oh this faq, I was looking to the forum one, thanks. |
| Perspektyva is offline | |
![]() |
| Tags |
| dir, directory, file, file list, list |
| Thread Tools | |
| Display Modes | |
|
Similar Threads | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| c program to print list of files in a directory | leo_1024 | Linux Programming | 3 | 01-24-2009 05:54 AM |
| Unknown memory leak with linked lists... | RaDeuX | C Programming | 6 | 12-07-2008 04:09 AM |
| List files in a directory (without folders) | 3saul | Linux Programming | 4 | 04-20-2006 01:08 AM |
| list size of files in directory | mayhem | C Programming | 3 | 02-27-2005 11:52 PM |
| List class | SilasP | C++ Programming | 0 | 02-10-2002 05:20 PM |