1. directory mng.
- Posted by Salix <salix at freemail.hu> Jul 10, 2006
- 610 views
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
2. Re: directory mng.
- Posted by Larry Miller <larrymiller at sasktel.net> Jul 10, 2006
- 593 views
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
3. Re: directory mng.
- Posted by "Greg Haberek" <ghaberek at gmail.com> Jul 10, 2006
- 600 views
> 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"