[thelist] Problem with php filesize()

CDitty mail at redhotsweeps.com
Sun Jun 17 11:02:26 CDT 2001


This is the only copy  I have received.  I actually tried that and for some 
reason, it didn't work.  I have no idea why it wouldn't work.  Same code 
used elsewhere works.  I actually gave up on this section and rewrote the 
working copy to handle this.

Strangest thing with this is that for some reason, some files had filesizes 
and others didn't.  Oh well. Go figure.  :)

Thanks

Chris

At 10:52 AM 6/17/2001, you wrote:
>I hope this doesn't get posted twice, but it doesn't look like my first post
>came through. Here's what I said:
>
>Chris,
>
>I was going through the comments in the online PHP documentation on readdir
>and filesize and caught this:
>
>"When executing a "readdir" command, filesize doesn't seem able to get the
>size of some files if they aren't in the same directory as the script. The
>workaround to this is changing the working directory with "chdir" in
>addition to "readdir"."
>
>Could this be your problem?
>
>http://www.php.net/manual/en/function.filesize.php
>
>--
>cdg
>
>----- Original Message -----
>From: "CDitty" <mail at redhotsweeps.com>
> > Does anyone know if there are any problems with filesize in php
> > 4.0.4pl1?  I am simply trying to get the filesize of a graphic and it
>keeps
> > showing as 0 bytes.
> >
> > My code will retrieve a file listing but not the size.  Any one know?
>Here
> > is my code.
> >
> > <?
> > $new_file_name = "cditty.jpg";
> > $userid = "cditty";
> > $handle = opendir("/home/$userid");
> > while(false!==($file = readdir($handle))){
> >      if($file == "cditty.jpg"){
> >           echo $file . " " . filesize($file) . "<br>";
> >      }
> > }
> > ?>
> >
> > Thanks
> >
> > Chris
>
>
>---------------------------------------
>For unsubscribe and other options, including
>the Tip Harvester and archive of TheList go to:
>http://lists.evolt.org Workers of the Web, evolt !





More information about the thelist mailing list