Create diretory with save game c++

Jun 18, 2017 at 6:26pm
Hello, I have a lot of questions about how to get a folder and a subfolder and a binary file

This function creates a subfolder and a binary file.

I actually get it to create the binary file but I can not create the folders how can I do this?

for example:

Bool function (const char * pchFile)


Here that creates the folders and the binary file ---> * pchFile


The function writes as follows: folder / subfolder / file.bin
Last edited on Jun 21, 2017 at 9:25pm
Jun 19, 2017 at 10:50pm
No link is for what I want to do.

I want it to create several folders but as I do not name the folders, then I need a code that will dump the folders that are here

Folder / subfolder / ....

Here that creates the folders and the binary file ---> * pchFile
Last edited on Jun 19, 2017 at 10:50pm
Jun 20, 2017 at 9:20am
It's not clear what you want to do.
Imagine your game is called game.exe and running in a folder D:\Mygame. Where would you like to create the folder(s) and how should they be named?
Jun 20, 2017 at 6:31pm
I'm sorry for my English, I'm terrible. That was not what he meant.

No matter the way. I just want to dump the data that is in this function

For example if I put a printf or messagebox to "pchFile"
It shows me this way \ Folder \ subfolder \ File.bin
Jun 20, 2017 at 9:49pm
Still, it's not clear what you want to do. Where are you from? I might be able to talk with you in your language.
Jun 21, 2017 at 1:13am
i am from portugal
Jun 21, 2017 at 11:20am
O que você deseja fazer?
Lamentamos mas não consigo falar Portuguesse realmente bom..
Last edited on Jun 21, 2017 at 11:23am
Jun 21, 2017 at 4:30pm
I might be able to talk with you in your language.

by all means do so but not on the public forum please, it's considered bad manners (in most countries)
Jun 21, 2017 at 7:14pm
Yes please! How can we talk?
Email, skype etc?
Do you understand what I meant by my post?
Last edited on Jun 21, 2017 at 7:15pm
Jun 21, 2017 at 7:46pm
Do you want to get the full path from a relative path? This can be done using Boost.Filesystem:
1
2
3
4
5
6
7
# include <iostream>
# include <boost/filesystem/operations.hpp>

int main() {
    namespace fs = boost::filesystem;
    std::cout << fs::system_complete("./your-file.txt") << '\n';
}
"/tmp/1498074200-881196982/./your-file.txt"

http://coliru.stacked-crooked.com/a/55aa96750224e572
Or soon with std::filesystem.

If you have <unistd.h> available, you can use getcwd() to obtain the current working directory. On Windows, you can use GetCurrentDirectory:
https://msdn.microsoft.com/en-us/library/windows/desktop/aa364934(v=vs.85).aspx
Last edited on Jun 21, 2017 at 7:47pm
Jun 21, 2017 at 7:50pm
by all means do so but not on the public forum please, it's considered bad manners (in most countries)


Oh I didn't know that. Ok sure.

@coolers21 PM me. No need to use your email/skype for that. :) I do partially, but I will try my best to help you ^^
Jun 22, 2017 at 9:08am
@wsxdr Okay, I already sent it.
Topic archived. No new replies allowed.