You didn't say what technology you were using for your I/O operations but
-
fopen_s()[
^] takes directory spec as part of the filename.
-
CreateFile()[
^] likewise.
- streams interface (varying APIs) all take directory spec.
The only place you can't do this is with the console output and debug/output window.