[PHP] Bad file descriptors

2001-01-23 Thread Kif

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] Indexing Remote Directory

2001-01-26 Thread Kif

hi,

if i want to index the filenames in a local directory its quite easy using
something like the following:

$startdir = "." ;
$the_directory = opendir($startdir) ;
  while($filename = readdir($the_directory))
{
 print("$filename = ");
 print(filesize($filename));
 print("");
}
closedir($the_directory);

But how can I use something like this to index a REMOTE directory?

I have tried $startdir = http://siteiwant.com/; with no joy
:(

Can someone help please
Thanks

Keith


-- 
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] Remote Directory listing

2001-01-27 Thread Kif

hi,

if i want to index the filenames in a local directory its quite easy using
something like the following:

$startdir = "." ;
$the_directory = opendir($startdir) ;
  while($filename = readdir($the_directory))
{
 print("$filename = ");
 print(filesize($filename));
 print("");
}
closedir($the_directory);

But how can I use something like this to index a REMOTE directory?

I have tried $startdir = http://siteiwant.com/; with no joy
:(

Can someone help please
Thanks




-- 
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] INAPPROPRIATE IOCTL ERROR

2001-02-01 Thread Kif

help...
ok, now this looks quite straightforward...

$filename="http://195.92.38.87/cgi-win/homeview.dll?details1?src=1050&Proper
tyCode=1050003/SAPHI/14665/3";
$file=fopen($filename,"r") or die("cant open $filename");
while(!feof($file)){
$line=fgets($file,4096);
echo $line;
}

but when i run it i get an error

fopen("http://195.92.38.87/cgi-win/homeview.dll?details1?src=1050&PropertyCo
de=1050003/SAPHI/14665/3","r") -
Inappropriate ioctl for device in /home/httpd/docs/test.php on line 6

So can someone please tell me, what the blazes an ioctl is and why do i have
an inappropriate one?

The remote file is fine,

Thanks

Kif



-- 
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] Inappropriate ioctl for device

2001-02-01 Thread Kif

help...
ok, now this looks quite straightforward...

$filename="http://195.92.38.87/cgi-win/homeview.dll?details1?src=1050&Proper
tyCode=1050003/SAPHI/14665/3";
$file=fopen($filename,"r") or die("cant open $filename");
while(!feof($file)){
$line=fgets($file,4096);
echo $line;
}

but when i run it i get an error

fopen("http://195.92.38.87/cgi-win/homeview.dll?details1?src=1050&PropertyCo
de=1050003/SAPHI/14665/3","r") -
Inappropriate ioctl for device in /home/httpd/docs/test.php on line 6

So can someone please tell me, what the blazes an ioctl is and why do i have
an inappropriate one?

The remote file is fine,

Thanks

Kif





-- 
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] Inappropriatte ioctl

2001-02-01 Thread Kif

help...
ok, now this looks quite straightforward...

$filename="http://remoteserver/path/file";
$file=fopen($filename,"r") or die("cant open $filename");
while(!feof($file)){
$line=fgets($file,4096);
echo $line;
}

but when i run it i get an error

fopen("http://195.92.38.87/cgi-win/homeview.dll?details1?src=1050&PropertyCo
de=1050003/SAPHI/14665/3","r") -

Inappropriate ioctl for device in /home/httpd/docs/test.php on line 6

So can someone please tell me, what the blazes an ioctl is and why do i have
an inappropriate one?

The remote file is fine,

Thanks

Kif



-- 
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]




Re: [PHP] Retrieve HTML page

2001-02-01 Thread Kif

something like this perhaps ?

$remotefile = file($remote_file_url);
$file_contents = join( '', $remotefile);

Cheers
Kif




- Original Message -
From: "Jared Howard" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Thursday, February 01, 2001 11:03 PM
Subject: [PHP] Retrieve HTML page


> I've been looking through the manual but I keep on missing the function or
> it doesn't exist.
> I need to know if there is a way to get a specified HTML page (as if you
> were to go to the page by typing in the url in your browser) and either
> turn it into a string or array or something that I would be able to cut up
> and use the information that I need.  This way PHP does the work instead
of
> going to the page yourself.
>
>
> --
> 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]