Just having an issue with an app. I'm brushing up on C++, by redeveloping a few work scripts from Bash to C++, in an attempt to sway them towards a redevelopment in the future. I will say though, I'm having a slight issue passing one particular command to the CLI, and just to point out, I'm running these C++ scripts on RHEL v6.3.
public : void check_Files()
{
string izscan = "/opt/mapbase/tools/izscan";
string lots = izscan + "/lots";
string log = izscan + "/log";
string lotsdad = izscan + "/lotsdad";
string maps = izscan + "/maps";
string temp3 = izscan + "/temp3";
string files;
if(system(NULL))
{
system("cd /opt/mapbase/tools/izscan/"); // This doesn't work.
system("ls /opt/mapbase/tools/izscan/"); // This works fine.
}
}
I've highlighted the lines of code where I'm having an issue with a comment relating to what does and does not work. Is there something I'm over looking when it comes to passing the CD command in Linux?