Copy command gives up after running for 70 times.

Discussion in 'PHP' started by arunsuriindia, Feb 27, 2007.

  1. #1
    here is the code.Now this code stops running after 70 times.
    Can anyone tell me what wrong in this


    <?php
    for ($c=6;$c>0;$c--)
    for ($b=12;$b>0;$b--)
    for ($a=31;$a>0;$a--)
    {
    if(strlen($a)==1)
    $a="0$a";
    if(strlen($b)==1)
    $b="0$b";
    if(strlen($c)==1)
    $c="0$c";
    $file="eq$a$b$c"."_csv.zip";
    $origin="http://www.bseindia.com/bhavcopy/$file";
    $dest="c:\\bse\\$file";
    if(!copy($origin,$dest))
    echo "$origin";
    }
    ?>
     
    arunsuriindia, Feb 27, 2007 IP
  2. mad4

    mad4 Peon

    Messages:
    6,986
    Likes Received:
    493
    Best Answers:
    0
    Trophy Points:
    0
    #2
    The script probably times out.

    Try putting set_time_limit(0); at the top of the script.
     
    mad4, Feb 27, 2007 IP
  3. jmafonseca

    jmafonseca Peon

    Messages:
    195
    Likes Received:
    5
    Best Answers:
    0
    Trophy Points:
    0
    #3
    Just out of curiosity, what are those csv's feeds?!! :D
     
    jmafonseca, Feb 27, 2007 IP
  4. mad4

    mad4 Peon

    Messages:
    6,986
    Likes Received:
    493
    Best Answers:
    0
    Trophy Points:
    0
    #4
    Comma Separated Values.
     
    mad4, Feb 27, 2007 IP
  5. arunsuriindia

    arunsuriindia Peon

    Messages:
    61
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #5
    yes set_time_out solved the problem
    it is end of day marketdata of a stock exchange
     
    arunsuriindia, Feb 27, 2007 IP