1424
|
1 // file-info.cc -*- C++ -*- |
|
2 /* |
|
3 |
1884
|
4 Copyright (C) 1996 John W. Eaton |
1424
|
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 |
|
40 file_info::file_info (void) |
|
41 { |
|
42 file_number = -1; |
|
43 file_fptr = 0; |
|
44 } |
|
45 |
1755
|
46 file_info::file_info (int n, const string& nm, FILE *t, const string& md) |
1424
|
47 { |
|
48 file_number = n; |
|
49 file_name = nm; |
|
50 file_fptr = t; |
|
51 file_mode = md; |
|
52 } |
|
53 |
|
54 file_info::file_info (const file_info& f) |
|
55 { |
|
56 file_number = f.file_number; |
|
57 file_name = f.file_name; |
|
58 file_fptr = f.file_fptr; |
|
59 file_mode = f.file_mode; |
|
60 } |
|
61 |
|
62 file_info& |
|
63 file_info::operator = (const file_info& f) |
|
64 { |
|
65 if (this != & f) |
|
66 { |
|
67 file_number = f.file_number; |
|
68 file_name = f.file_name; |
|
69 file_fptr = f.file_fptr; |
|
70 file_mode = f.file_mode; |
|
71 } |
|
72 return *this; |
|
73 } |
|
74 |
|
75 file_info::~file_info (void) |
|
76 { |
|
77 } |
|
78 |
|
79 int |
|
80 file_info::number (void) const |
|
81 { |
|
82 return file_number; |
|
83 } |
|
84 |
|
85 string |
|
86 file_info::name (void) const |
|
87 { |
|
88 return file_name; |
|
89 } |
|
90 |
|
91 FILE * |
|
92 file_info::fptr (void) const |
|
93 { |
|
94 return file_fptr; |
|
95 } |
|
96 |
|
97 string |
|
98 file_info::mode (void) const |
|
99 { |
|
100 return file_mode; |
|
101 } |
|
102 |
|
103 /* |
|
104 ;;; Local Variables: *** |
|
105 ;;; mode: C++ *** |
|
106 ;;; page-delimiter: "^/\\*" *** |
|
107 ;;; End: *** |
|
108 */ |