]>
Commit | Line | Data |
---|---|---|
cacbc350 RK |
1 | ------------------------------------------------------------------------------ |
2 | -- -- | |
fbf5a39b | 3 | -- GNAT COMPILER COMPONENTS -- |
cacbc350 | 4 | -- -- |
fbf5a39b | 5 | -- T E M P D I R -- |
cacbc350 RK |
6 | -- -- |
7 | -- S p e c -- | |
8 | -- -- | |
fbf5a39b | 9 | -- Copyright (C) 2003 Free Software Foundation, Inc. -- |
cacbc350 RK |
10 | -- -- |
11 | -- GNAT is free software; you can redistribute it and/or modify it under -- | |
12 | -- terms of the GNU General Public License as published by the Free Soft- -- | |
13 | -- ware Foundation; either version 2, or (at your option) any later ver- -- | |
14 | -- sion. GNAT is distributed in the hope that it will be useful, but WITH- -- | |
15 | -- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -- | |
16 | -- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -- | |
17 | -- for more details. You should have received a copy of the GNU General -- | |
18 | -- Public License distributed with GNAT; see file COPYING. If not, write -- | |
cb5fee25 KC |
19 | -- to the Free Software Foundation, 51 Franklin Street, Fifth Floor, -- |
20 | -- Boston, MA 02110-1301, USA. -- | |
cacbc350 | 21 | -- -- |
cacbc350 | 22 | -- GNAT was originally developed by the GNAT team at New York University. -- |
71ff80dc | 23 | -- Extensive contributions were provided by Ada Core Technologies Inc. -- |
cacbc350 RK |
24 | -- -- |
25 | ------------------------------------------------------------------------------ | |
26 | ||
fbf5a39b AC |
27 | -- This package is used by gnatmake and by the Project Manager to create |
28 | -- temporary files. If environment variable TMPDIR is defined and | |
29 | -- designates an absolute path, temporary files are create in this directory. | |
30 | -- Otherwise, temporary files are created in the current working directory. | |
cacbc350 | 31 | |
fbf5a39b AC |
32 | with GNAT.OS_Lib; use GNAT.OS_Lib; |
33 | with Types; use Types; | |
cacbc350 | 34 | |
fbf5a39b | 35 | package Tempdir is |
cacbc350 | 36 | |
fbf5a39b AC |
37 | procedure Create_Temp_File |
38 | (FD : out File_Descriptor; | |
39 | Name : out Name_Id); | |
40 | -- Create a temporary text file and return its file descriptor and | |
41 | -- its path name as a Name_Id. If environment variable TMPDIR is defined | |
42 | -- and its value is an absolute path, the temp file is created in the | |
43 | -- directory designated by TMPDIR, otherwise, it is created in the current | |
44 | -- directory. If temporary file cannot be created, FD gets the value | |
45 | -- Invalid_FD and Name gets the value No_Name. | |
cacbc350 | 46 | |
fbf5a39b | 47 | end Tempdir; |