[Zope] Accessing file contents (LocalFS)

Max M maxm@mxm.dk
Wed, 16 Jan 2002 16:40:47 +0100


Mark Snellings wrote:

> Given a filename, I can access the contents with:
> 
> 	<dtml-var "test['foo.txt'].data">
> 
> And I can iterate over all the files in the LocalFS with:
> 
>     <dtml-in "test.fileIds()">
>         <dtml-var sequence-item>
>     </dtml-in>
> 
> 		OR
> 
>     <dtml-in "test.fileValues()">
>         <dtml-var id>
>     </dtml-in>
> 
> But how do I iterate over all the files in the LocalFS, displaying the
> contents of each file as I go?


you probably only need to combine a few of the things you allready know 
(untested)::

     <dtml-in "test.fileIds()">
         <dtml-var "_['sequence-item'].data">
     </dtml-in>

Beware that they are all text files though ;-)

regards Max M