/* create a directory and then delete */
if(_mkdir(newdir) == 0)
{
printf(\"nDirectory %s was successfully createdn\", newdir);
system(\"dir \\testdir\");
if(_rmdir(\"\\testdir\") == 0)
printf(\"nDirectory %s was successfully removedn\", newdir);
else
printf(\"nProblem removing directory %sn\", newdir);
}
else
printf(\"nProblem creating directory %sn\", newdir);
/* uses _chdir() function to verify that a given directory exists */
printf(\"n\");
printf(\"Change directory........n\");
if(_chdir(path1))
printf(\"Unable to locate the directory: %sn\", path1);
else
system(\"dir *.log /a\");
printf(\"n\");
return0;
}
The output:
输出:
Available drives in this machine are:
C: D: F:
本机当前可用的驱动器有:
C: D: F:
Type drive letter to check: c
Current directory on that drive is:
c:Program FilesMicrosoft Visual Studio .NET 2003Common7IDE