Create diretory with save game c++

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
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
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?
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
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.
i am from portugal
O que você deseja fazer?
Lamentamos mas não consigo falar Portuguesse realmente bom..
Last edited on
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)
Yes please! How can we talk?
Email, skype etc?
Do you understand what I meant by my post?
Last edited on
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
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 ^^
@wsxdr Okay, I already sent it.
Topic archived. No new replies allowed.