Hello, Ibrahim!

On Sat, 2 May 1998, Ibrahim Haddad wrote:

>My code:
>--------
> if (strcmp(castedPtr->tname, "") == 0)
>    /* check if string is empty and display warning message */
>    missingInputCB (w, clientData, callData);
>  else /* delete file name that matches the value of castedPtr->tname */
>    system("rm -f castedPtr->tname");
>
>However,     system("rm -f castedPtr->tname")
>is not working because the rm command will be searching for a file called 
>castedPtr->tname to delete it while in fact this pointer holds the file name.
>
>Is there a way to get around this?

why not use remove(castedPtr->tname) ?

Btw, try to avoid using system() syscall. It probably expanding to fork(),
execv() and wait() sequence. And incredibly unsafe. And in linux it uses
bash, that is large enough for memory usage...

Bye.
--
Good night to spend with family, but avoid arguments with your mate's
new lover.

--
    With best of best regards, Pawel S. Veselov (aka Black Angel)
                   Internet e-mail : [EMAIL PROTECTED]
    Web page : http://www.math.spbu.ru/~vps/ | ICQ UIN : 5252265

Reply via email to