1
<!--$Id: env_set_tmp_dir.so,v 10.7 2001/06/25 13:40:41 bostic Exp $-->
2
<!--Copyright 1997-2001 by Sleepycat Software, Inc.-->
3
<!--All rights reserved.-->
6
<title>Berkeley DB: DB_ENV->set_tmp_dir</title>
7
<meta name="description" content="Berkeley DB: An embedded database programmatic toolkit.">
8
<meta name="keywords" content="embedded,database,programmatic,toolkit,b+tree,btree,hash,hashing,transaction,transactions,locking,logging,access method,access methods,java,C,C++">
11
<a name="2"><!--meow--></a>
12
<table width="100%"><tr valign=top>
14
<h1>DB_ENV->set_tmp_dir</h1>
17
<a href="../api_c/c_index.html"><img src="../images/api.gif" alt="API"></a><a href="../reftoc.html"><img src="../images/ref.gif" alt="Ref"></a>
25
DB_ENV->set_tmp_dir(DB_ENV *dbenv, const char *dir);
28
<a name="3"><!--meow--></a>
29
<p>The path of a directory to be used as the location of temporary files.
30
The files created to back in-memory access method databases will be
31
created relative to this path. These temporary files can be quite large,
32
depending on the size of the database.
33
<p>If no directories are specified, the following alternatives are checked
34
in the specified order. The first existing directory path is used for
37
<p><li>The value of the environment variable <b>TMPDIR</b>.
38
<li>The value of the environment variable <b>TEMP</b>.
39
<li>The value of the environment variable <b>TMP</b>.
40
<li>The value of the environment variable <b>TempFolder</b>.
41
<li>The value returned by the GetTempPath interface.
42
<li>The directory <b>/var/tmp</b>.
43
<li>The directory <b>/usr/tmp</b>.
44
<li>The directory <b>/temp</b>.
45
<li>The directory <b>/tmp</b>.
46
<li>The directory <b>C:/temp</b>.
47
<li>The directory <b>C:/tmp</b>.
49
<p>Note: environment variables are only checked if one of the
50
<a href="../api_c/env_open.html#DB_USE_ENVIRON">DB_USE_ENVIRON</a> or <a href="../api_c/env_open.html#DB_USE_ENVIRON_ROOT">DB_USE_ENVIRON_ROOT</a> flags were
52
<p>Note: the GetTempPath interface is only checked on Win/32 platforms.
53
<p>The DB_ENV->set_tmp_dir interface may be used only to configure Berkeley DB before
54
the <a href="../api_c/env_open.html">DB_ENV->open</a> interface is called.
55
<p>The DB_ENV->set_tmp_dir function returns a non-zero error value on failure and 0 on success.
56
<p>The database environment's temporary file directory may also be set using the environment's
57
<b>DB_CONFIG</b> file. The syntax of the entry in that file is a
58
single line with the string "set_tmp_dir", one or more whitespace characters,
59
and the directory name. Because the <b>DB_CONFIG</b> file is read when the database
60
environment is opened, it will silently overrule configuration done
63
<p>The DB_ENV->set_tmp_dir function may fail and return a non-zero error for the following conditions:
65
<p><dt>EINVAL<dd>An invalid flag value or parameter was specified.
66
<p>Called after <a href="../api_c/env_open.html">DB_ENV->open</a> was called.
68
<p>The DB_ENV->set_tmp_dir function may fail and return a non-zero error for errors specified for other Berkeley DB and C library or system functions.
69
If a catastrophic error has occurred, the DB_ENV->set_tmp_dir function may fail and return
70
<a href="../ref/program/errorret.html#DB_RUNRECOVERY">DB_RUNRECOVERY</a>, in which case all subsequent Berkeley DB calls will fail
73
<a href="../api_c/env_create.html">db_env_create</a>,
74
<a href="../api_c/env_close.html">DB_ENV->close</a>,
75
<a href="../api_c/env_err.html">DB_ENV->err</a>, <a href="../api_c/env_err.html">DB_ENV->errx</a>
76
<a href="../api_c/env_open.html">DB_ENV->open</a>,
77
<a href="../api_c/env_remove.html">DB_ENV->remove</a>,
78
<a href="../api_c/env_set_alloc.html">DB_ENV->set_alloc</a>,
79
<a href="../api_c/env_set_cachesize.html">DB_ENV->set_cachesize</a>,
80
<a href="../api_c/env_set_data_dir.html">DB_ENV->set_data_dir</a>,
81
<a href="../api_c/env_set_errcall.html">DB_ENV->set_errcall</a>,
82
<a href="../api_c/env_set_errfile.html">DB_ENV->set_errfile</a>,
83
<a href="../api_c/env_set_errpfx.html">DB_ENV->set_errpfx</a>,
84
<a href="../api_c/env_set_feedback.html">DB_ENV->set_feedback</a>,
85
<a href="../api_c/env_set_flags.html">DB_ENV->set_flags</a>,
86
<a href="../api_c/env_set_mutexlocks.html">DB_ENV->set_mutexlocks</a>,
87
<a href="../api_c/env_set_pageyield.html">db_env_set_pageyield</a>,
88
<a href="../api_c/env_set_paniccall.html">DB_ENV->set_paniccall</a>,
89
<a href="../api_c/env_set_panicstate.html">db_env_set_panicstate</a>,
90
<a href="../api_c/env_set_rec_init.html">DB_ENV->set_recovery_init</a>,
91
<a href="../api_c/env_set_rpc_server.html">DB_ENV->set_rpc_server</a>,
92
<a href="../api_c/env_set_region_init.html">db_env_set_region_init</a>,
93
<a href="../api_c/env_set_shm_key.html">DB_ENV->set_shm_key</a>,
94
<a href="../api_c/env_set_tas_spins.html">db_env_set_tas_spins</a>,
95
<a href="../api_c/env_set_tmp_dir.html">DB_ENV->set_tmp_dir</a>,
96
<a href="../api_c/env_set_verbose.html">DB_ENV->set_verbose</a>,
97
<a href="../api_c/env_strerror.html">db_strerror</a>
99
<a href="../api_c/env_version.html">db_version</a>.
101
<table width="100%"><tr><td><br></td><td align=right>
102
<a href="../api_c/c_index.html"><img src="../images/api.gif" alt="API"></a><a href="../reftoc.html"><img src="../images/ref.gif" alt="Ref"></a>
104
<p><font size=1><a href="http://www.sleepycat.com">Copyright Sleepycat Software</a></font>