Changes the current working directory for an application, while setting the old working directory into a supplied parameter. This function can be used later to change the working directory back to its previous location.
int chgCwd(string newPath, string *oldPath)
Parameter |
Description |
---|---|
newPath |
Directory of the new path. |
oldPath |
Pointer to the string that chgCwd places in the current working directory. |
Integer.
Returns 1 for success, and 0 for failure.
string new_path;
string old_path;
int rv;
new_path = "/home/impact/app1";
rv = chgCwd(new_path, &old_path);
if (rv == 0)
{
erm("Error changing working directory to [%s]!!!",
new_path);
}
Copyright © 2005. Sybase Inc. All rights reserved. |
![]() |