P
PengYu.UT
The following code open the file "example.txt" in the current
directory.
int main () {
ofstream myfile;
myfile.open ("example.txt");
myfile << "Writing this to a file.\n";
myfile.close();
return 0;
}
But I'm wondering how to code to support the search path such as
$AWK_PATH? That is to say if I want to open some file, if it is not
under the current directory, it will search all the directories in
$AWK_PATH until one is found. Is there any standard C++ package to
support this? Or is there any sample code?
Thanks,
Peng
directory.
int main () {
ofstream myfile;
myfile.open ("example.txt");
myfile << "Writing this to a file.\n";
myfile.close();
return 0;
}
But I'm wondering how to code to support the search path such as
$AWK_PATH? That is to say if I want to open some file, if it is not
under the current directory, it will search all the directories in
$AWK_PATH until one is found. Is there any standard C++ package to
support this? Or is there any sample code?
Thanks,
Peng