%SYN_SETDIR

Set the current directory path

WTSupported in traditional Synergy on Windows
WNSupported in Synergy .NET on Windows
USupported on UNIX
VSupported on OpenVMS
status = %SYN_SETDIR(path)

Return value

status

One of the following values: (n)

1 = Successful

0 = Not successful

Arguments

path

The path for the directory you want to set as the current directory. (a)

Discussion

%SYN_SETDIR does not support relative paths (for example, ..\) or logicals.

On Windows, although changing a directory to a UNC path is valid, doing so restricts you from subsequently spawning any command that uses the command interpreter cmd.exe, because cmd does not support a default directory of anything other than a mapped or subst drive. For example, you would not be able to spawn (or do an open pipe) of a dir command or spawn a .bat command procedure.

If %SYN_SETDIR is not successful, the system error code can be retrieved using %SYSERR.

Examples

This example sets the current directory path to C:\mydir.

record
    sts         ,i4
proc
    sts = %syn_setdir("C:\mydir")
    if (.not. sts)
      writes(1, "cannot change to required directory")