There are only so many files that your OS can have open at any one time --
Perhaps you are hitting that limit?...

I think you can increase this with...  "ulimit"???

Another possibility is that if you need to copy an entire directory
structure, rather than making PHP walk through it copying one file at a
time, you could just do:

<?php
    exec("cp /path/to/source/dir /path/to/dest/dir", $results, $error);
    while (list(,$line) = each($results)){
        echo $line,"<BR>\n";
    }
    if ($error){
        die("OS Error $error.  Usually paths/permissions.<BR>\n");
    }
?>

You probably need some flags to that cp like -r -f or whatever, depending on
what you want to over-write what.

--
Visit the Zend Store at http://www.zend.com/store/
Wanna help me out?  Like Music?  Buy a CD: http://l-i-e.com/artists.htm
Volunteer a little time: http://chatmusic.com/volunteer.htm
----- Original Message -----
From: "Kif" <[EMAIL PROTECTED]>
Newsgroups: php.general
Sent: Tuesday, January 23, 2001 10:55 PM
Subject: [PHP] Bad file descriptors


> Hi
>
> I recently wrote a script that copies about 200 data files from a remote
> server, and stores them locally.
>
> It does this under cron every night
>
> Everything has been fine for a couple of weeks, but now when running the
> script I get an error message that reads
>
> Warning: file(http://remote.server.com/file.html) - Bad file descriptor in
> /home/convert.php on line ...
>
> And the files that the script is copying and referring to are all zero
> length.
>
> This doesn't happen all the time. some nights I may get no error messages
> and other times I get lots of them.
> Last night it was nearly all of them.
>
> The problem seems to be getting increasingly worse as time passes.
>
> I have checked the data files (about half are html and half are images)
and
> they seem fine.
>
> I'm a bit new to php and I really have no idea what the error message
means.
> Can someone help and explain what might be going on please
>
> Thanks
>
> Kif
> [EMAIL PROTECTED]
>
>
>
>
>
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
>


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to