Re: [PHP] RE: looking for two remote functions

2007-03-12 Thread Jim Lucas

Riyadh S. Alshaeiq wrote:

Thank you Mickey, but I have already looked in there and the function posted
in the notes is working just fine for getting the size on disk which I am
not interested in, I need the actual size that when you download a file to a
machine you will get..

Riyadh

-Original Message-
From: Mikey [mailto:[EMAIL PROTECTED] 
Sent: 9/Mar/2007 2:57 PM

To: php-general@lists.php.net
Subject: Re: looking for two remote functions

Riyadh S. Alshaeiq wrote:

Hello everybody,

 I am looking for an HTTP function for getting remote filesizes. Keeping

in

mind that I am NOT interested in getting the size on disk figure, I need
the actual size of the files when downloaded to a local machine. Please

let

me know if there are any..

Another thing, I also need a remote function that gets the created date

and

last modified separately, if possible..

Best regards

 





Try looking here:

http://uk.php.net/manual/en/function.filesize.php

If the function itself isn't of use to you, look further down in the 
notes and I am sure you will find something useful.


Mikey


Ok, been listening/reading this for a few days now.

Are you wanting to get the block size of a file that you plan on 
downloading from a server to your local computer?


If so, is your client going to be on a windows box or *nix box or mac?

They all have different block size.

Default for linux is 1024, default for openbsd is 512, and probably even 
different for a mac even though it is running a flavor of bsd.


You can see how this might cause a problem in determining the number of 
blocks that a given file will occupy once downloaded.


There is now php/javascript/html/css/etc... function that will give you 
the block size of the client.  Only then would you be able to calculate 
the actually number of blocks that will be required for any given download.


You can, how ever, calculate the number of blocks that a file takes up 
on a server, by looking at various specs on the system.

ls -s filename
will return to you the number of blocks that a file occupies on the 
server file system.  This number may, but probably not, correspond to 
the number of blocks the same file will occupy on your client system.


Hope this clears things up a bit.

I will be glad to offer more advice if more is needed.

--
Enjoy,

Jim Lucas

Different eyes see different things. Different hearts beat on different 
strings. But there are times for you and me when all such things agree.


- Rush

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] RE: looking for two remote functions

2007-03-12 Thread Richard Lynch
It seems MUCH more likely to me that the filesize() is being used on
some kind of URL that does a re-direct -- and the filesize() may not
follow the re-direct for you...

The size is the size, in bytes.

Overhead in the local OS for block management is not something PHP
will be able to predict for you, I don't think.

On Mon, March 12, 2007 5:52 pm, Jim Lucas wrote:
 Riyadh S. Alshaeiq wrote:
 Thank you Mickey, but I have already looked in there and the
 function posted
 in the notes is working just fine for getting the size on disk which
 I am
 not interested in, I need the actual size that when you download a
 file to a
 machine you will get..

 Riyadh

 -Original Message-
 From: Mikey [mailto:[EMAIL PROTECTED]
 Sent: 9/Mar/2007 2:57 PM
 To: php-general@lists.php.net
 Subject: Re: looking for two remote functions

 Riyadh S. Alshaeiq wrote:
 Hello everybody,

  I am looking for an HTTP function for getting remote filesizes.
 Keeping
 in
 mind that I am NOT interested in getting the size on disk figure,
 I need
 the actual size of the files when downloaded to a local machine.
 Please
 let
 me know if there are any..

 Another thing, I also need a remote function that gets the created
 date
 and
 last modified separately, if possible..

 Best regards





 Try looking here:

 http://uk.php.net/manual/en/function.filesize.php

 If the function itself isn't of use to you, look further down in the
 notes and I am sure you will find something useful.

 Mikey

 Ok, been listening/reading this for a few days now.

 Are you wanting to get the block size of a file that you plan on
 downloading from a server to your local computer?

 If so, is your client going to be on a windows box or *nix box or mac?

 They all have different block size.

 Default for linux is 1024, default for openbsd is 512, and probably
 even
 different for a mac even though it is running a flavor of bsd.

 You can see how this might cause a problem in determining the number
 of
 blocks that a given file will occupy once downloaded.

 There is now php/javascript/html/css/etc... function that will give
 you
 the block size of the client.  Only then would you be able to
 calculate
 the actually number of blocks that will be required for any given
 download.

 You can, how ever, calculate the number of blocks that a file takes up
 on a server, by looking at various specs on the system.
   ls -s filename
 will return to you the number of blocks that a file occupies on the
 server file system.  This number may, but probably not, correspond to
 the number of blocks the same file will occupy on your client system.

 Hope this clears things up a bit.

 I will be glad to offer more advice if more is needed.

 --
 Enjoy,

 Jim Lucas

 Different eyes see different things. Different hearts beat on
 different
 strings. But there are times for you and me when all such things
 agree.

 - Rush

 --
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php




-- 
Some people have a gift link here.
Know what I want?
I want you to buy a CD from some starving artist.
http://cdbaby.com/browse/from/lynch
Yeah, I get a buck. So?

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php