Let's create the folder returned by gimp_temp_directory() ourselves, the first time this function is called, using a randomized name. This will ensure that we won't conflict with another user running GIMP on the same machine if using the base /tmp/ (which is usually the case on Linux). Furthermore, since we create the temp folder at this level, we will also delete it when quitting (but only if it's empty, as it should). Also I use a single-level folder above the generic temporary directory, this way, it's easier to track and we don't have to delete 2 levels of directories anymore. When the environment variable GIMP3_TEMPDIR is set though, we do not create the folder, nor do we try and delete it.
35 lines
1.1 KiB
C
35 lines
1.1 KiB
C
/* LIBGIMP - The GIMP Library
|
|
* Copyright (C) 1995-1997 Peter Mattis and Spencer Kimball
|
|
*
|
|
* gimpenv-private.h
|
|
*
|
|
* This library is free software: you can redistribute it and/or
|
|
* modify it under the terms of the GNU Lesser General Public
|
|
* License as published by the Free Software Foundation; either
|
|
* version 3 of the License, or (at your option) any later version.
|
|
*
|
|
* This library is distributed in the hope that it will be useful,
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
* Lesser General Public License for more details.
|
|
*
|
|
* You should have received a copy of the GNU Lesser General Public
|
|
* License along with this library. If not, see
|
|
* <https://www.gnu.org/licenses/>.
|
|
*/
|
|
|
|
#ifndef __GIMP_ENV_PRIVATE_H__
|
|
#define __GIMP_ENV_PRIVATE_H__
|
|
|
|
G_BEGIN_DECLS
|
|
|
|
/* For information look into the C source or the html documentation */
|
|
|
|
|
|
void gimp_env_init (gboolean plug_in);
|
|
void gimp_env_exit (gboolean plug_in);
|
|
|
|
|
|
G_END_DECLS
|
|
|
|
#endif /* __GIMP_ENV_PRIVATE_H__ */
|