Direct-opening a temporary file using the user's preferred application
Kevin Krammer
krammer at kde.org
Fri Apr 12 00:30:27 PDT 2013
On Thursday, 2013-04-11, Jan Kundrát wrote:
> On Wednesday, 10 April 2013 20:15:26 CEST, Nicolas Mailhot wrote:
> > When tmpfs is a ramdisk it is fast *but* limited to ram+swap size. So on
> > current systems it is quite easy to saturate it with a few files in the
> > hundred megs/gigabyte size.
>
> Do such systems point their $TMPDIR into a ramdisk-backed location? If they
> do, do they also offer another place with more available space? How can
> one access that place?
I guess in your case you could use $XDG_CACHE_HOME (defaults to $HOME/.cache)
and an application specific subdirectory.
The first time a user clicks an attachment you download it to that location
and remember the filename. If the users closes the launched program and clicks
the attachment again, you can quickly launch the application again because the
cache still contains the downloaded file.
Also, since it is a cache, you decide when to clear it. You could check file
access times, store meta data or clear it on shutdown or next startup.
Cheers,
Kevin
--
Kevin Krammer, KDE developer, xdg-utils developer
KDE user support, developer mentoring
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 190 bytes
Desc: This is a digitally signed message part.
URL: <http://lists.freedesktop.org/archives/xdg/attachments/20130412/6515569e/attachment.pgp>
More information about the xdg
mailing list