Bruce Momjian said:
>
> OK, next question. Why does this work when compiled in MinGW and run
> from CMD.EXE:
>
> # cat x.c
> #include <stdio.h>
>
> main()
> {
> system("copy \"c:/msys/1.0/home/bruce momjian/a b\"
> \"c:/msys/1.0/home/bruce momjian/c d\"");
> }
> # gcc -o x x.c
> # ./x
> 1 file(s) copied.
>
> C:\msys\1.0\home\Bruce Momjian>x
> 1 file(s) copied.
>
> The path has forward slashes and spaces.
>
>
on XP Pro a similar test gives me:
C:\msys\1.0\home\adunstan>copytry
copy "c:/tmp/a b" "c:/tmp/c d"
The system cannot find the file specified.
0 file(s) copied.
C:\msys\1.0\home\adunstan>dir c:\tmp
Volume in drive C has no label.
Volume Serial Number is D899-679E
Directory of c:\tmp
08/10/2004 10:36 PM <DIR> .
08/10/2004 10:36 PM <DIR> ..
06/14/2004 05:33 PM 9,244 a b
06/14/2004 05:33 PM 9,244 INSTALL.LOG
2 File(s) 18,488 bytes
2 Dir(s) 51,230,498,816 bytes free
but with backslashes, I get:
C:\msys\1.0\home\adunstan>copytry
copy "c:\tmp\a b" "c:\tmp\c d"
1 file(s) copied.
and with backslashes in the source only I get:
C:\msys\1.0\home\adunstan>copytry
copy "c:\tmp\a b" "c:/tmp/c d"
1 file(s) copied.
go figure ...
cheers
andrew