To check folder existence you can use WinApi::pathExists,
to create one WinApi::createDirectory or WinApi::createDirectoryPath:
str path = 'C:\\tmp\\aFolder';
;
if (!WinApi::pathExists(path))
{
WinApi::createDirectoryPath(path);
}
I have no idea what is meant by "the appropriate file", but have a look at the TextIO, BinaryIO or the other *IO classes.