1424
|
1 // file-info.cc -*- C++ -*- |
|
2 /* |
|
3 |
|
4 Copyright (C) 1993, 1994, 1995 John W. Eaton |
|
5 |
|
6 This file is part of Octave. |
|
7 |
|
8 Octave is free software; you can redistribute it and/or modify it |
|
9 under the terms of the GNU General Public License as published by the |
|
10 Free Software Foundation; either version 2, or (at your option) any |
|
11 later version. |
|
12 |
|
13 Octave is distributed in the hope that it will be useful, but WITHOUT |
|
14 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
|
15 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
|
16 for more details. |
|
17 |
|
18 You should have received a copy of the GNU General Public License |
|
19 along with Octave; see the file COPYING. If not, write to the Free |
|
20 Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
|
21 |
|
22 */ |
|
23 |
1453
|
24 // Written by John C. Campbell <jcc@bevo.che.wisc.edu> |
1424
|
25 // |
|
26 // Thomas Baier <baier@ci.tuwien.ac.at> added the following functions: |
|
27 // |
|
28 // popen pclose execute sync_system async_system |
|
29 // waitpid mkfifo unlink |
|
30 |
|
31 |
|
32 #ifdef HAVE_CONFIG_H |
|
33 #include <config.h> |
|
34 #endif |
|
35 |
|
36 #include <cstdio> |
|
37 |
|
38 #include "file-info.h" |
|
39 // #include "utils.h" |
|
40 |
|
41 file_info::file_info (void) |
|
42 { |
|
43 file_number = -1; |
|
44 file_fptr = 0; |
|
45 } |
|
46 |
|
47 file_info::file_info (int n, const char *nm, FILE *t, const char *md) |
|
48 { |
|
49 file_number = n; |
|
50 file_name = nm; |
|
51 file_fptr = t; |
|
52 file_mode = md; |
|
53 } |
|
54 |
|
55 file_info::file_info (const file_info& f) |
|
56 { |
|
57 file_number = f.file_number; |
|
58 file_name = f.file_name; |
|
59 file_fptr = f.file_fptr; |
|
60 file_mode = f.file_mode; |
|
61 } |
|
62 |
|
63 file_info& |
|
64 file_info::operator = (const file_info& f) |
|
65 { |
|
66 if (this != & f) |
|
67 { |
|
68 file_number = f.file_number; |
|
69 file_name = f.file_name; |
|
70 file_fptr = f.file_fptr; |
|
71 file_mode = f.file_mode; |
|
72 } |
|
73 return *this; |
|
74 } |
|
75 |
|
76 file_info::~file_info (void) |
|
77 { |
|
78 } |
|
79 |
|
80 int |
|
81 file_info::number (void) const |
|
82 { |
|
83 return file_number; |
|
84 } |
|
85 |
|
86 string |
|
87 file_info::name (void) const |
|
88 { |
|
89 return file_name; |
|
90 } |
|
91 |
|
92 FILE * |
|
93 file_info::fptr (void) const |
|
94 { |
|
95 return file_fptr; |
|
96 } |
|
97 |
|
98 string |
|
99 file_info::mode (void) const |
|
100 { |
|
101 return file_mode; |
|
102 } |
|
103 |
|
104 /* |
|
105 ;;; Local Variables: *** |
|
106 ;;; mode: C++ *** |
|
107 ;;; page-delimiter: "^/\\*" *** |
|
108 ;;; End: *** |
|
109 */ |