Subject | Re: [ib-support] Trouble with TMP_DIRECTORY |
---|---|
Author | Claudio Valderrama C. |
Post date | 2002-04-07T00:07:12Z |
<guido.klapperich@...> wrote in message
news:3CAEEA13.7352825A@......
documentation never was fixed. It should be instead
TMP_DIRECTORY 10000000 "d:\ibtemp"
If this is the last entry in ibconfig, make sure to press ENTER/RETURN so
there's a newline following it, otherwise scanf() pattern matching fails.
TMP_DIRECTORY is an IB/FB setting. It doesn't change the operating system's
temp directory. If it exists, it will take precedence over the OS's
environment TEMP variable only for the engine, since ibconfig only makes
sense to IB/FB. It doesn't change the current directory of the engine
either. Thus, the entry
TMP_DIRECTORY 10000000 "d:\ibtemp"
says to the engine to ignore the environment variable TEMP and use this
setting instead to create sort files. However, the TMP (or INTERBASE_TMP)
environment variable will affect isql's placement of temporary (history)
files.
On the other side, what F_IBTEMPPATH() returns is simply the value of
GetTempPath() and this is a Win32 API call. Beware this value is stored in a
global variable at startup inside FreeUdfLib, so it won't reflect your
changes to environment variables in the operating system, unless you make
sure the engine unloaded the UDF. From the MS SDK:
Windows 95/98: The GetTempPath function gets the temporary file path as
follows:
- The path specified by the TMP environment variable.
- The path specified by the TEMP environment variable, if TMP is not defined
or if TMP specifies a directory that does not exist.
- The current directory, if both TMP and TEMP are not defined or specify
nonexistent directories.
Windows NT/2000: The GetTempPath function does not verify that the directory
specified by the TMP or TEMP environment variables exists. The function gets
the temporary file path as follows:
- The path specified by the TMP environment variable.
- The path specified by the TEMP environment variable, if TMP is not
defined.
- The Windows directory, if both TMP and TEMP are not defined.
If you use exclusively the OS's TEMP environment variable and set nothing in
ibconfig, then the UDF gets the same setting than the engine. If you use
TMP_DIRECTORY in ibconfig, this setting overrides any environment variables,
but obviously only to the engine, not for other programs. You won't want to
rely on the generic TEMP/TMP environment variables because they will make
any program to use the same temporary dir, not only the engine. If you don't
want to use TMP_DIRECTORY in ibconfig, you can use INTERBASE_TMP environment
variable that only affects the engine. The UDF never reads ibconfig; it's
only asking the OS and the OS relies on TEMP and TMP as explained above in
the SDK.
More about those settings in the Operations Guide (despite the bug with the
missing double quotes around paths).
C.
--
Claudio Valderrama C. - http://www.cvalde.com - http://www.firebirdSql.org
Independent developer
Owner of the Interbase® WebRing
news:3CAEEA13.7352825A@......
> I have the following entry in my ibconfigThis is wrong. It works from IB5 onwards but for odd reasons, the
> TMP_DIRECTORY 10000000 d:\ibtemp
documentation never was fixed. It should be instead
TMP_DIRECTORY 10000000 "d:\ibtemp"
If this is the last entry in ibconfig, make sure to press ENTER/RETURN so
there's a newline following it, otherwise scanf() pattern matching fails.
> But when I run the sql-statementYou're mixing apples and oranges here (use your favorite fruits instead).
> SELECT F_IBTEMPPATH() FROM RDB$DATABASE (Function from FreeUdf)
> it always returns c:\winnt\temp.
TMP_DIRECTORY is an IB/FB setting. It doesn't change the operating system's
temp directory. If it exists, it will take precedence over the OS's
environment TEMP variable only for the engine, since ibconfig only makes
sense to IB/FB. It doesn't change the current directory of the engine
either. Thus, the entry
TMP_DIRECTORY 10000000 "d:\ibtemp"
says to the engine to ignore the environment variable TEMP and use this
setting instead to create sort files. However, the TMP (or INTERBASE_TMP)
environment variable will affect isql's placement of temporary (history)
files.
On the other side, what F_IBTEMPPATH() returns is simply the value of
GetTempPath() and this is a Win32 API call. Beware this value is stored in a
global variable at startup inside FreeUdfLib, so it won't reflect your
changes to environment variables in the operating system, unless you make
sure the engine unloaded the UDF. From the MS SDK:
Windows 95/98: The GetTempPath function gets the temporary file path as
follows:
- The path specified by the TMP environment variable.
- The path specified by the TEMP environment variable, if TMP is not defined
or if TMP specifies a directory that does not exist.
- The current directory, if both TMP and TEMP are not defined or specify
nonexistent directories.
Windows NT/2000: The GetTempPath function does not verify that the directory
specified by the TMP or TEMP environment variables exists. The function gets
the temporary file path as follows:
- The path specified by the TMP environment variable.
- The path specified by the TEMP environment variable, if TMP is not
defined.
- The Windows directory, if both TMP and TEMP are not defined.
If you use exclusively the OS's TEMP environment variable and set nothing in
ibconfig, then the UDF gets the same setting than the engine. If you use
TMP_DIRECTORY in ibconfig, this setting overrides any environment variables,
but obviously only to the engine, not for other programs. You won't want to
rely on the generic TEMP/TMP environment variables because they will make
any program to use the same temporary dir, not only the engine. If you don't
want to use TMP_DIRECTORY in ibconfig, you can use INTERBASE_TMP environment
variable that only affects the engine. The UDF never reads ibconfig; it's
only asking the OS and the OS relies on TEMP and TMP as explained above in
the SDK.
More about those settings in the Operations Guide (despite the bug with the
missing double quotes around paths).
C.
--
Claudio Valderrama C. - http://www.cvalde.com - http://www.firebirdSql.org
Independent developer
Owner of the Interbase® WebRing