pgfSweave icon indicating copy to clipboard operation
pgfSweave copied to clipboard

Clean up old cache directories

Open yihui opened this issue 13 years ago • 5 comments

I think I can understand the situation now. The only thing that makes me uncomfortable is the creation of new cache directories without removing the old ones, thus each time I change a code chunk, I get a new directory created.

This is not a really big issue, though. I can live with it.

yihui avatar May 03 '11 04:05 yihui

I agree, that is somewhat unfortunate, but I think the benefits outweigh the negatives. It still respects the cache dir so you wont have directories cluttering up the main folder. Maybe I should set a default for the cache dir to not be ., perhaps pgfSweaveCache?

cameronbracken avatar May 03 '11 18:05 cameronbracken

or maybe remove the dir's with the same prefix and only keep the most recent one? (do this in the function pgfSweave())

yihui avatar May 03 '11 18:05 yihui

That is actually a good suggestion, the only reason to keep the extras around is if the code is changed back to an exact older state, which I think is quite unlikely.

This could be done in pgfSweave after the code has been run but I wonder if it might not be easier to do it in the driver. At that level we would have the names of the code chunks and their checksums to do an easy clobber of all the old cache directories.

cameronbracken avatar May 03 '11 19:05 cameronbracken

I'm changing the name of the issue if you dont mind. from

external=TRUE --> cache=TRUE

to

Clean up old cache directories

cameronbracken avatar May 03 '11 19:05 cameronbracken

I don't mind at all. I just jumped from the email to github and did not consider a meaningful title.

yihui avatar May 03 '11 19:05 yihui