Updated fstat(), new funcs to "Basic Functions"
| From: | Faisal Nasim | Date: | Fri, 03 Mar 2000 07:08:16 +0000 |
| Subject: | Updated fstat(), new funcs to "Basic Functions" | ||
| Groups: | php.dev | ||
| Request: | Send a blank email to php-dev+get-16330@lists.php.net to get a copy of this message | ||
Hi,
Tested under RH60, PHP4b4pl1.
Here is an updated version of fstat() to my previous
version which returned numerical associatvie array....
(array) fstat ( int fp );
$x = fstat ( $fp );
print $x [ 'size' ]; // size of the file pointed by $fp
New functions in "Basic Functions":
* ip2long { int ip2long ( string ) }
* long2ip { string ip2long ( int ) }
Will save some bytes when storing in the database, and
should be applicable in some other places as well.....
You'll need 15 bytes to store an IP, but converting
it to integer will store it into 4 bytes.
Enjoy!
Faisal
Attachment: [application/octet-stream] file.h.patch
Attachment: [application/octet-stream] basic_functions.h.patch
Attachment: [application/octet-stream] file.c.patch
Attachment: [application/octet-stream] basic_functions.c.patch
Attachment: [application/octet-stream] file.h.patch
Attachment: [application/octet-stream] basic_functions.h.patch
Attachment: [application/octet-stream] file.c.patch
Attachment: [application/octet-stream] basic_functions.c.patch