0

My professor gave us a VCS project to work on. He wanted us to just create a repository and copy a given project folder into the repo. However, he said he wanted everything in c++ and that it shouldn't be OS dependent. I've been researching a lot on the internet for some solutions but I only come across two things that might help. There was adding boost or start using c++17. I'm not sure how to install or switch version to c++17 when I'm using visual studio 2017. Is there any advice or suggestion that can help me create directory folders?

Here is the summary assumptions for my project:
1. All files in the project tree (ptree) will be included. (No exception black-list.)
2. No frills: We ignore user input mistakes; we provide no embedded help.
3. A file artifact (AKA version) will consist of the full file contents. (No deltas/diffs.)
4. The repo (repository) will include the ptree (project tree) folder hierarchy.
5. Each ptree file will get a “leaf” folder of the same name to hold that file's artifacts (initially just the first artifact). Thus, if ptree folder xcp/ has two files fred.c and jack.txt, the repo will have folder xcp/ as well as leaf sub-folders fred.c/ and jack.txt/ – where leaf folder fred.c/ will contain all that ptree file's fred.c artifacts (e.g., 4F89-L102.c) and leaf folder jack.txt/ will contain all that ptree file's jack.txt artifacts.
6. We will create an artifact ID (ArtID) code name as discussed below.
7. The artifact (file version) that is in a leaf folder gets named by it's ArtID code name.
8. Assume that both source tree and target repo folders exist and that free disk space is adequate.
9. A command-line interface is sufficient.
10. Assume the target repo folder and is empty.

But for now, I think the main goal that my professor wants us to do is copy the source path and onto the target folder and a folder for all the text files.

Randy Le
  • 1
  • 2
  • 4
    See [``](https://en.cppreference.com/w/cpp/filesystem) and this: https://stackoverflow.com/questions/41308933/how-to-enable-c17-compiling-in-visual-studio – NathanOliver Sep 21 '18 at 18:09
  • At some point in the calling chain, a system command or interface must be called. – Thomas Matthews Sep 21 '18 at 18:11
  • 1
    Almost certainly your instructor has given you the basic tools, or info on where to get info on basic tools, to solve this problem. Any solution will be graded on how well you use the material provided. Asking for assistance is fine, but you risk doing something that you don't quite understand, or exceeds the scope of how your solution is to be coded. –  Sep 21 '18 at 18:32
  • 1
    From your descriptions, it seems a lot like "create a repository and copy a given project folder into the repo" are instructions on how to deal with your project, **not** meant to be programmed. You **might** sometimes have to write a program that can create directory, but this isn't it, I think. – sehe Sep 21 '18 at 20:06
  • @jdv I see, he didn't really give us any basic tools. He said something about using recursions. I would give you the description of the project. So the simple assumption for the project is. 1. All files in the project tree (ptree) will be included. 2. No frills: we ignore user input mistakes; we provide no embedded help. 3. A file artifact (Aka vrsion) will consist of the full file contents. 4. The repo will include the ptree folder hierarchy. 5. Each ptree file will get a "lead folder" of the same name that file's artifacts. Thus, if ptree folder xcp/ has two files fred.c and jack.txt – Randy Le Sep 22 '18 at 19:51
  • where leaf folder fred.c/ will contain all the ptree file's fed.c artifacts and a leaf file jack.txt/ will contain all the ptree file's jack.txt artifacts. 6. we will create a artifact ID coden ame as discussed. 7. The artifact that is in a leaf folder gets names by it's ArtID code name. 8. Assume that both source tree and target repo folders exist and that free disk space adequate. 9. A command line interface in sufficient. 10. Assume the target repo folder is empty – Randy Le Sep 22 '18 at 19:53
  • @RandyLe clarification to questions should be in the text of the question, not comments. Comments can be removed. SO is not a threaded forum, but a Q&A site. See [ask]. –  Sep 24 '18 at 14:34

1 Answers1

-1

I did find a few ways of doing it. I ended up using #include dirent.h, sys/lib.h, and sys/stat.h to make directories and subdirectories.

Randy Le
  • 1
  • 2