cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Upayavira>
Subject Re: Deleting original files after ZipArchiveSerialization
Date Mon, 15 Mar 2004 15:22:23 GMT
This won't work. Actions are performed whilst the pipeline is built, 
before it is executed. Therefore, you're trying to delete a file before 
it has been used by the pipeline. So whatever your immediate problem is, 
you've got a bigger one! I guess I'd extend the ZipArchiveSerialiser and 
give it the functionality to do a deletion itself, or, better - come up 
with something using flow to handle this particular bit of logic.

Regards, Upayavira

Tuomo L wrote:

>I'm using the ZipArchiveSerializer to zip up some files. I need to give
>the user an option to check a box saying "Delete original files after
>compression". I wrote a FileDeleteAction, which uses
> method to delete these
>files. The action works separately just fine, but when trying to run it
>inside the same request where ZipArchiveSerialization happens, I get an
>error indicating that the file(s) couldn't  be deleted. It seems that they
>are still locked for reading by the serializer.
>Could someone please check, that the serializer closes all streams etc.
>correctly, or what else might be the problem?
><map:match uri="">
>  <map:generate src="some-entries.xml"/>
>  <map:serialize type="zip"/>
><map:match uri="compress-and-delete">
>  <map:act type="do-something-with-the-zip-file">
>    <map:parameter name="src" value="cocoon:/"/>
>    <map:act type="file-delete">
>      <map:parameter name="src" value="path-to-the-originals"/>
>    </map:ac>
>  </map:act>

View raw message