INF: String Constants Containing Paths

ID Number: Q23740

3.00 4.00 5.00 5.10 6.00 6.00a 6.00ax 7.00 | 5.10 6.00 6.00a

MS-DOS | OS/2

Summary:

In Microsoft C versions 5.0, 5.1, 6.0, 6.0a, 6.0ax, and C/C++ version

7.0, using spawnl() to invoke a child process works properly from the

current directory; however, it does not work properly when the child is

in another directory.

More Information:

MS-DOS uses the backslash character (\) to separate directory names. C

language also uses the backslash as an escape character to indicate

special characters, such as the end of a line (\n). The following

spawnl() command does not work as expected:

spawnl(P_WAIT,"c:\dir1\file.exe","file.exe",NULL);

To place a backslash into a string constant, use a double backslash

(\\). Thus, the correct call to spawn is the following:

spawnl(P_WAIT,"c:\\dir1\\file.exe","file.exe",NULL);

Additional reference words: 5.00 5.10 6.00 6.00a 6.00ax 7.00