Arí Ricardo Ody schreef:
I type and run the following command in a console window of Fedora Core 5:
tar --gzip --create --verbose --file=/home/ricardo/tmp/xxx.tar.gz
/home/ricardo/testesfpc/ebcdic_ascii/*.* /home/ricardo/testesfpc/h.o
/home/ricardo/testesfpc/h.pas
and it runs ok. The only message was: tar: Removing leading `/' from
member names.
Then I copy the command and move it to a TProcess.CommandLine and run a
program that execute the command:
TProcessExecute;
And I receive 3 messages back:
1. tar: Removing leading `/' from member names
2. tar: /home/ricardo/testesfpc/ebcdic_ascii/*.*: Impossible stat: File
or directory not found
3. tar: Output delayed by the previous errors
(messages was free translated from portuguese, but the meaning was
maintained)
My question is:
Why the TAR command ran OK in console and didn't run OK via
TProcess.Execute?
When you run this command from the command line, the command line
interpreter expends the *.* wildchar.
so suppose /home/ricardo/testesfpc/ebcdic_ascii contains three files,
file1.txt, file2.txt, file3.txt it actually executes (all on one line):
tar --gzip --create --verbose --file=/home/ricardo/tmp/xxx.tar.gz
/home/ricardo/testesfpc/ebcdic_ascii/file1.txt
/home/ricardo/testesfpc/ebcdic_ascii/file2.txt
/home/ricardo/testesfpc/ebcdic_ascii/file3.txt
/home/ricardo/testesfpc/h.o
/home/ricardo/testesfpc/h.pas
The tar program doesnn't see *.* but the actual files when executed from
the command line.
If you execute tar with TProcess, it sees a file with name literally
*.*. Such file does not exist and you get the message Impossibel stat.
HTH,
Vincent
_________________________________________________________________
To unsubscribe: mail [EMAIL PROTECTED] with
"unsubscribe" as the Subject
archives at http://www.lazarus.freepascal.org/mailarchives