Make user-defined file hidden

Hello,

I am writing a program in c++, and in the program I'd like to have the user input a file to be created that is hidden. I know that in UNIX, which I program on, if you put a dot in front of the filename it is hidden. The problem is, I don't want the user to have to type in .<filename>.<extension>. If there is a way they can type in <filename>.<extension> and somehow I can convert that string to .<filename>.<extension>, and then do ofstreamvariable.open(filename.c_str()) that would be cool. Does anyone possibly know how I can do that?
Like this:
 
filename = "." + filename;

Depending on your compiler, I think you may have to make a string from the dot first.
Last edited on
Topic archived. No new replies allowed.