لدي برنامج بلغه C++ اريد المساعده في حله وقد توصلت الى جزء من الحل
Write a program *****alent to the DOS command “ DIR “ (Remember: you can access DOS from windows using cmd.exe, the help of the DIR command can be seen with DIR /?).
Your program should list the files in the directory and sub-directory with some options to sort, file selection, and display. The program should be called MDIR.
Some rules :
1. The search has to be done in one run, the information has to be stored in memory. Recursivity can be used. No display should be done at this stage.
2. The display is done in a second step using prinft and following the sort options
3. The internal data structures and the source code have to be “object oriented”. The structure has to be simple but it should be possible to show 2000 or 3000 files (be careful with memory consumption)
4. The source code should be efficiently commented. It is better to implement less sort options and do better comments.
5. The command MDIR should be auto-documented (MDIR /? Should show the information)
6. The code has to be done in C or C++ for windows and unix (you can use compiler directives when needed)
7. Include (it does not need to be compiled) some unit test for your code. Indicate which unit-test framework did you used
8. Do it simple but clear, reliable, generic and easy to maintain.
الكود الذي توصلت اليه:
struct ffblk StructDisk;
int nFileExists = 0;