Jump to content

Attachments Cache


Recommended Posts

I noticed when you open an attachment requiring an external software, the attachment gets copied to ....Evernote\Databases\Attachments...  Does that ever auto cleanup?  I only see things about a week old, but not sure how often I've opened attachments on this computer.

Link to comment

I'd have to look at the actual code, but I think the only time we clean up is when we know the application we started has exited. That's not always possible. I'm not sure we have any code that actually says "oh, this is old so we should clean up". (If EN isn't running, it's perfectly safe to delete all files in that folder)

Link to comment
  • Level 5*

I always thought that that was done via some combination of CreateProcess() (or maybe InvokeVerb()?) and FindFirstChangeNotification(). Evernote seems to know when an attachment is changed (e.g. select an image, open with Paint.net, modify it there, and save --> the image is updated immediately), and as noted, you haveto know when the process you opened it with is finished, so you can do a cleanup. The handoff back doesn't always work (some programs lock the files they have open for editing), or something else screwy happens (where I used to work, we had a similar system, and every once in a whiile it would go cross-eyed and not see the app close, we couldn't ever figure out why). I'm pretty sure once Evernote is closed, it ignores stuff in the Attachments folder; if you close Evernote before closing an editing application, then the cleanup can't happen.

Link to comment
  • Level 5*
2 hours ago, Gear64 said:

I noticed when you open an attachment requiring an external software, the attachment gets copied to ....Evernote\Databases\Attachments...  Does that ever auto cleanup?  I only see things about a week old, but not sure how often I've opened attachments on this computer.

Nope.  Any residue can be deleted whenever you like.  Just don't have anything open in another app at the time.

Link to comment
  • Level 5*
3 minutes ago, dconnet said:

It doesn't work at all for UWP programs... (you get no valid handle back that you can monitor)

UWP, wasn't a problem for our case; kinda after my time there (something like 7 or so years ago, now), it was all straight-up Windows applications. And only failed rarely because of course they did. :) 

Link to comment
  • Level 5*
6 minutes ago, Gear64 said:

Most of my attachments are pdfs I view inline anyway; but concerned over time there might be heavy duplication of drive space if not monitored.

I wouldn't worry about heavy, but good to keep an eye on it.  :)

Link to comment

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...