[vlc-devel] [PATCH v2 1/13] core: add config_GetTempPath()
jnqnfe at gmail.com
Tue Oct 6 21:52:49 CEST 2020
On Tue, 2020-10-06 at 17:45 +0300, Rémi Denis-Courmont wrote:
> Le tiistaina 6. lokakuuta 2020, 8.56.34 EEST Lyndon Brown a écrit :
> > From: Lyndon Brown <jnqnfe at gmail.com>
> > Date: Mon, 5 Oct 2020 20:16:48 +0100
> > Subject: core: add config_GetTempPath()
> > to provide a common interface to the system/user temporary
> > directory.
> There's already ISO standard tmpfile() for creating temporary files,
> vlc_memfd() if you absolutely need a POSIX file descriptor, or
> vlc_mkstemp() if
> you really need a file name (which is bad, as it risks leaking
> storage space).
> I don't think we should be creating a lower-level / harder-to-use
> helper here.
Yes, but the point of the first helper (config_GetTempPath) is to
provide a missing solution for knowing the path to use with vlc_mkstemp
on each platform (when wanting to create a file in the temp dir rather
than CWD), and the point of the second helper (vlc_MakeTmpFile) is just
to simplify and avoid code duplication involved in
using config_GetTempPath and vlc_mkstemp together.
More information about the vlc-devel