[Zope] show filesize in LocalFS

Michael Bleijerveld michael@bleijerveld.nl
Tue, 15 Jul 2003 23:34:28 +0200


Hi,

Still receive an error message ''Error Type: AttributeError  Error Value:
fileObjects" when using these statements.

<dtml-var size missing="oops">
<dtml-in "admin.fileObjects()">
  <dtml-var sequence-item>  <dtml-var "bobobase_modification_time()">
</dtml-in>

Michael

----- Original Message ----- 
From: "John Ziniti" <jziniti@speakeasy.org>
To: <zope@zope.org>
Sent: Wednesday, July 16, 2003 12:14 AM
Subject: Re: [Zope] show filesize in LocalFS


> You *did* make sure to use admin.fileObjects() as well,
> right?  That's more important.  If you did and are still
> getting errors, I would recommend some debugging
> stuff that will make sure that the objects you are
> iterating are correct.  Also, I don't know if directories
> have a "size" attribute, so you may want to catch
> that:
>
> <dtml-var size missing="oops">
>
> Other than that, I am out of ideas.  Things work OK
> for me over here ...
>
> JZ
>
>
> Michael Bleijerveld wrote:
>
> >Hi,
> >
> >I tried <dtml-var size> but I get the same error.
> >
> >Regards,
> >
> >Michael
> >
> >
> >----- Original Message ----- 
> >From: "John Ziniti" <jziniti@speakeasy.org>
> >To: "Michael Bleijerveld" <michael@bleijerveld.nl>
> >Cc: <Zope@zope.org>
> >Sent: Tuesday, July 15, 2003 9:16 PM
> >Subject: Re: [Zope] show filesize in LocalFS
> >
> >
> >
> >
> >>><dtml-in "admin.fileIds()">
> >>> <dtml-var sequence-item>  <dtml-var "bobobase_modification_time()">
> >>>
> >>>
> ><dtml-var "get_size()">
> >
> >
> >>></dtml-in>
> >>>
> >>>
> >>>
> >>"fileIds()" returns only a *list* of files in the directory,
> >>in this case "admin".  What you want to use is
> >><dtml-in "admin.fileObjects()">.  But I still don't think
> >>that "get_size()" is a method of LocalFile objects.  I
> >>think you should use <dtml-var size>, which indicates
> >>the size of the file in bytes, as returned by
> >>"os.stat(path)[stat.ST_SIZE]".
> >>
> >>HTH,
> >>
> >>JZ
> >>
> >>
> >>_______________________________________________
> >>Zope maillist  -  Zope@zope.org
> >>http://mail.zope.org/mailman/listinfo/zope
> >>**   No cross posts or HTML encoding!  **
> >>(Related lists -
> >> http://mail.zope.org/mailman/listinfo/zope-announce
> >> http://mail.zope.org/mailman/listinfo/zope-dev )
> >>
> >>
> >>
> >>
> >
> >
> >
> >_______________________________________________
> >Zope maillist  -  Zope@zope.org
> >http://mail.zope.org/mailman/listinfo/zope
> >**   No cross posts or HTML encoding!  **
> >(Related lists -
> > http://mail.zope.org/mailman/listinfo/zope-announce
> > http://mail.zope.org/mailman/listinfo/zope-dev )
> >
> >
> >
> >
>
>
> _______________________________________________
> Zope maillist  -  Zope@zope.org
> http://mail.zope.org/mailman/listinfo/zope
> **   No cross posts or HTML encoding!  **
> (Related lists -
>  http://mail.zope.org/mailman/listinfo/zope-announce
>  http://mail.zope.org/mailman/listinfo/zope-dev )
>
>