in reply to Re: Slew or error messages
in thread Slew or error messages

I intentionally left the code general so that people could try it out themselves. the & came in from the HTML thingamajig, somehow.

gqcam is a webcam program. I merely want to launch it in the background and have it update the cam every $howevermany seconds. It saves a file that is uploaded to the ftp server by this snippet of code.

As for $boink, I would like for the loop to be infinite until i close that terminal window or kill the process.

Replies are listed 'Best First'.
Re: Re: Re: Slew or error messages
by runrig (Abbot) on Aug 08, 2001 at 00:59 UTC
    You might have some contention issues if you start your upload while gqcam is rewriting the file. You might want to rename the file first, wait a bit, then upload the renamed file. And go ahead and use system to start gqcam: system('gqcam &') and die "Error starting gqcam";

    For an infinite loop, all you need is a bare block:

    LOOP: { #do stuff redo LOOP; }

    What sort of errors does gqcam 'spew'?? Are they significant, or can you just redirect them to /dev/null and ignore them?

      gqcam barfs out some variable errors or something, i forget exactly what, but it is my belief that gqcam (through some programming fault of mine) is getting the ftp commands as input and is thoroughly confused by them. While it's barfing out these errors, I am also able to see the gqcam variables zipping about on their little sliders.
        Does gqcam just generate a file intermittently? Then I don't see how ftp would interfere with it. You need to narrow down the problem, take out the ftp and see what happens if you just sleep in a loop. Maybe gqcam is not getting some environment variable or argument it needs?

        Or does it spawn some GUI and generate files as a side effect? Then I'd run it as an entirely separate process and the ftp script as another process. I might do that anyway.