1. directory mng.

I have a CGI script that I want to check the directory it's running in 
and deletes the content of some subdirectories (e.g. temp).

system("del temp/*.*",2)
-- doesn't seem to work


Any idea how to get around the confirmation that is asked by the system?

Cheers,

Salix

new topic     » topic index » view message » categorize

2. Re: directory mng.

Salix wrote:
> 
> I have a CGI script that I want to check the directory it's running in 
> and deletes the content of some subdirectories (e.g. temp).
> 
> }}}
<eucode>
> system("del temp/*.*",2)
> -- doesn't seem to work
> </eucode>
{{{

> 
> Any idea how to get around the confirmation that is asked by the system?
> 
> Cheers,
> 
> Salix

This should work:

system("del >nil /q temp\\*.*",2)

>nil redirects console output to the nil device so will not be visible.

the /q switch suppresses confirmations.

Larry MIller

new topic     » goto parent     » topic index » view message » categorize

3. Re: directory mng.

> system("del >nil /q temp\\*.*",2)

You'll want to put the redirection last, and the options after the
directory. Also, the direction is NUL not nil. And don't forget to
quote your path names.

The correct format would be: "del \"temp\\*.*\" /q > NUL"

new topic     » goto parent     » topic index » view message » categorize

Search



Quick Links

User menu

Not signed in.

Misc Menu