Hmm, thinking about it, I see that I wrote nonsense:
On Tue, Jul 31, 2012 at 06:53:57PM +0200, Alexander Burger wrote:
> However, I suspect that 'request' is not needed here at all, as you
> create new +File objects. So 'new' is the way:
In fact, I suspect that you of course want to reuse the file objects,
that's what the 'backups' list is for.
So to use 'request', you have to decide what the definite key is for a
file. This is not easy. You might use the inode
(let Obj (request '(+File) 'inode ...)
(put> Obj ..)
but in your examle always the same inode (4) is used. Instead, you might
use the path 'pth'
(let Obj (request '(+File) 'pth P)
but the pathname of a file may change.
Also, inodes are not exactly right, because a file might be pointed to
by several inodes (hardlinks). I did something exactly along that line
for a project a few years ago, and it became a pretty complicated model.
One other point: While this
(put> Obj 'backups Bk)
is OK, you have to keep in mind that for each file this list grows with
each backup. To avoid that the +File objects become too big, you should
think about cutting the list down when it reaches a certain size.