Beefy Boxes and Bandwidth Generously Provided by pair Networks
P is for Practical

Re: Problem with system ()

by MZSanford (Curate)
on Mar 18, 2003 at 14:20 UTC ( #243984=note: print w/replies, xml ) Need Help??

in reply to Problem with system ()

You may want to use cwd in your program, then use system(). Beware of the fact that on most systems (and i suspect Win32 too) system() opens a new shell for each call. So, your first would chage directory and then close, and your second would delete files in the current directory.

As a side note, if you are deleteing files you may want to look at unlink, which will let you check the status of your deletes. (glob + unlink = gooood)

from the frivolous to the serious

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://243984]
[tye]: 1) The python stack traces show you the names of variables, not the values of variables. Almost never informative.
[LanX]: do you have a py job now?
[tye]: Right now I have errors trying to fetch stuff from graphite. It says 'apps not ready, check startup logs'. I eventually find the startup logs and see 'no apps found'. Looking for fixes to this problem...
[LanX]: no idea ... ask py monks! ;-p
[tye]: it turns out that this can be caused by almost anything going wrong. If you want to know what caused the problem, you have to try to load each app by-hand to see what problems it is having, because none of those will be logged.
[tye]: No, I write more Perl than py at work. But I have to deal with plenty of py things.
[tye]: py monks would just be offended.
[Corion]: ;)
[Corion]: Hi tye btw ;)
[Corion]: I found plenty of not chatty enough logs with Perl too ... I'm slowly coming to appreciate Log::Log4perl resp. our homegrown alternative

How do I use this? | Other CB clients
Other Users?
Others examining the Monastery: (8)
As of 2017-09-21 20:13 GMT
Find Nodes?
    Voting Booth?
    During the recent solar eclipse, I:

    Results (252 votes). Check out past polls.