Hello, I am relatively new to programing, only took programming I and II so far, and I am attempting to create a program that gathers information on files in a folder, and it's subfolders, and prints said information to an html table.
The information it would extract is:
- The name of each file
- Where each file is located
- What purpose does the file serve
- If it's code, what other files does it reference
This would then be printed to an html table so that certain files are easier to find.
Thus far this is what I've written (just started),
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80
|
#include <cstdlib>
#include <iostream>
#include <fstream>
using namespace std;
using namespace System;
using namespace System::IO;
//Functions
void openRoot ();
void query ();
void openSubDirs ();
void queryFiles ();
int createTable ();
/// Vars
int filesLeft;
int filesRemaining;
int main(int argc, char *argv[])
{
ofstream navigate;
char getDir;
void openRoot () {
cout << "Please enter a root directory to index ... " << endl << endl;
cin >> getDir;
navigate.open(getDir);
if (getDir == NULL)
{
while (bool goBack == true)
{
cerr << "Please enter a valid directory ..." << endl;
cin >> getDir;
if(getDir == false)
{
bool goBack == true;
}
else
{
bool goBack == false;
}
}
}
else
{
void query ()
{
cout << "Searching for files and subdirectories ... " << endl << endl << endl;
for (filesLeft > filesTotal; filesLeft++)
{
void rootSize ()
{
try
{
array <String^> dirs^ = Directory::Getfiles(getDir);
Console::WriteLine(dirs -> filesTotal);
Collections::IEnumerator^ myEnum = dirs -> GetEnumorator();
while (myEnum -> MoveNext() )
{
Console::WriteLine( myEnum -> Current );
}
}
catch ( Exception^ getDir)
{
cerr << "An excseption has occured ..." << endl;
}
}
}
|
Now, I understand that this is nothing great yet, but this is just to get something on paper so to speak. Anyway, any tips and clues of how I could accomplish this would be greatly appreciated. :)
P.S. This is not for a class, this is something I wanted to do for the office I'm interning at to make finding files on web servers easier to find and edit. I already started make such an index manually. However, this is my last week and I wont be able to finish it that way. I have also heard that this might be easier to do in python, but my experience is in C++ and I don't have time to learn it.