jakarta-jcs-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Aaron Smuts <asm...@yahoo.com>
Subject Re: Indexed Disk Cache safe copying of files
Date Wed, 17 Jun 2009 21:10:25 GMT

Ok.  We might also want to ad retry to the delete in case another instance is reading.

We can implement removeAll, we can simply clear the directory.

We also might want to make it possible to limit the number of files and to cleanup based on
age.  

Your patch is against really old code.  I'm updating.

Aaron


--- On Wed, 6/17/09, Tore Halset <halset@pvv.ntnu.no> wrote:

> From: Tore Halset <halset@pvv.ntnu.no>
> Subject: Re: Indexed Disk Cache safe copying of files
> To: "JCS Users List" <jcs-users@jakarta.apache.org>
> Date: Wednesday, June 17, 2009, 1:57 PM
> On Jun 17, 2009, at 22:50, Aaron
> Smuts wrote:
> 
> > We need to think through the way updates are
> done.  If these will be shared, we'll have to have some
> kind of lock, perhaps another file with the same name with a
> .lock suffix. . .  . . .
> 
> As you see from the patch, I create a new tmp file and
> rename it after write. Several writers can write in
> parallel, and the last will win.
> 
> File tmp = File.createTempFile("cache", null, dir);
> ...
> tmp.renameTo(file);
> 
> Regards,
>  - Tore.
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: jcs-users-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: jcs-users-help@jakarta.apache.org
> 
> 

---------------------------------------------------------------------
To unsubscribe, e-mail: jcs-users-unsubscribe@jakarta.apache.org
For additional commands, e-mail: jcs-users-help@jakarta.apache.org


Mime
View raw message