Thursday, March 05, 2009
EXECV
When U use system(), it will help U extract the * or wildcard to the current file.
So such as tar will run sucessuflly.
If U use the execv(), it will just run the arg which u give.
Sample.
/father.c mother.c son.c daughter.c
system("ls *") ==> ls father.c mother.c son.c daughter.c
execv( "ls", argv[]") ===> ls *
It's funny, but thanks shell help us extract wild card.
So such as tar will run sucessuflly.
If U use the execv(), it will just run the arg which u give.
Sample.
/father.c mother.c son.c daughter.c
system("ls *") ==> ls father.c mother.c son.c daughter.c
execv( "ls", argv[]") ===> ls *
It's funny, but thanks shell help us extract wild card.
Subscribe to Posts [Atom]
Scrape It |