Really, I’m just generally confused on how to create a file in a subdirectory of the current working directory, but especially if it’s hidden.
Say char* backup contains the name of the file we’re creating with an open() call.
Say there’s a hidden folder which already exists called .mybackup.
How do I create the file inside of .mybackup? Hopefully without chdir’ing twice.
Where I’m at so far:
int filewrite;
filewrite = open(backup, O_CREAT | O_RDWR, 0644);
Prepend the filename with the directory you’d like it to be placed in. Or,
chdiring twice would also be acceptable.