[Zope3-dev] Re: zope.filerepresentation.interfaces.IWriteFile

Luis De la Parra lparrab at gmx.net
Fri Sep 29 17:08:17 EDT 2006


>> There is an interface called IWriteFile in the module
>> zope.filerepresentation.interfaces.
>> 
>> It defines one method "write(data)" with the doc string:
>> 
>> "Update the file data"
>> 
>> There are some problems I have with this:
>> 
>> a) The interface is yet another interface for doing a file-like object.
>> How many of those are around?
> 
> Oh, which others are there?
> 
>> b) It *seems intended* not to be really file-like but that "update the
>> file data" means: writing to this will replace all previous data

b)
writing to a file without first seeking to the end will replace its contents
(in 'w-rite' mode), so I think all applications currently just "opening"
(adapting) to IWriteFile and writing to it will still work if this
is "fixed" to be like a real file

a)well.. while not exactly the same, I think these 3 are (should be)
similar: 

zope.app.file
zope.file 
z3c.extfile

it might be a good idea to try to unify these and get a good "file"-like
object in the zope core which everyone can use.

maybe a first step would be to include zope.file in the default
distribution, and replace all zope.app.file usage with it, since zope.file
seems to be a super set of zope.app.file (in sense functionality) and more
like a real file, and as a second step you might replace z3c.extfile with
zope.file with a blob-enabled zodb

then we have z3c.filetype and zope.mimetype. For what I've seen,
z3c.filetype is in a better shape, but both of them seem to be similar.
so you could unify them as well and then replace zope.app.file.image with a
zope.file plus the image interface from filetype/mimetype 

regards.
luis




More information about the Zope3-dev mailing list