annotate liboctave/file-ops.h @ 5210:996a08a3eb06 ss-2-9-0

[project @ 2005-03-15 20:46:03 by jwe]
author jwe
date Tue, 15 Mar 2005 20:46:03 +0000
parents 5fa9670b5956
children 4c8a2e4e0717
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
1765
a51354c34bea [project @ 1996-01-23 03:33:34 by jwe]
jwe
parents:
diff changeset
1 /*
a51354c34bea [project @ 1996-01-23 03:33:34 by jwe]
jwe
parents:
diff changeset
2
2847
8b262e771614 [project @ 1997-03-27 16:18:26 by jwe]
jwe
parents: 2800
diff changeset
3 Copyright (C) 1996, 1997 John W. Eaton
1765
a51354c34bea [project @ 1996-01-23 03:33:34 by jwe]
jwe
parents:
diff changeset
4
a51354c34bea [project @ 1996-01-23 03:33:34 by jwe]
jwe
parents:
diff changeset
5 This file is part of Octave.
a51354c34bea [project @ 1996-01-23 03:33:34 by jwe]
jwe
parents:
diff changeset
6
a51354c34bea [project @ 1996-01-23 03:33:34 by jwe]
jwe
parents:
diff changeset
7 Octave is free software; you can redistribute it and/or modify it
a51354c34bea [project @ 1996-01-23 03:33:34 by jwe]
jwe
parents:
diff changeset
8 under the terms of the GNU General Public License as published by the
a51354c34bea [project @ 1996-01-23 03:33:34 by jwe]
jwe
parents:
diff changeset
9 Free Software Foundation; either version 2, or (at your option) any
a51354c34bea [project @ 1996-01-23 03:33:34 by jwe]
jwe
parents:
diff changeset
10 later version.
a51354c34bea [project @ 1996-01-23 03:33:34 by jwe]
jwe
parents:
diff changeset
11
a51354c34bea [project @ 1996-01-23 03:33:34 by jwe]
jwe
parents:
diff changeset
12 Octave is distributed in the hope that it will be useful, but WITHOUT
a51354c34bea [project @ 1996-01-23 03:33:34 by jwe]
jwe
parents:
diff changeset
13 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
a51354c34bea [project @ 1996-01-23 03:33:34 by jwe]
jwe
parents:
diff changeset
14 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
a51354c34bea [project @ 1996-01-23 03:33:34 by jwe]
jwe
parents:
diff changeset
15 for more details.
a51354c34bea [project @ 1996-01-23 03:33:34 by jwe]
jwe
parents:
diff changeset
16
a51354c34bea [project @ 1996-01-23 03:33:34 by jwe]
jwe
parents:
diff changeset
17 You should have received a copy of the GNU General Public License
a51354c34bea [project @ 1996-01-23 03:33:34 by jwe]
jwe
parents:
diff changeset
18 along with Octave; see the file COPYING. If not, write to the Free
a51354c34bea [project @ 1996-01-23 03:33:34 by jwe]
jwe
parents:
diff changeset
19 Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
a51354c34bea [project @ 1996-01-23 03:33:34 by jwe]
jwe
parents:
diff changeset
20
a51354c34bea [project @ 1996-01-23 03:33:34 by jwe]
jwe
parents:
diff changeset
21 */
a51354c34bea [project @ 1996-01-23 03:33:34 by jwe]
jwe
parents:
diff changeset
22
a51354c34bea [project @ 1996-01-23 03:33:34 by jwe]
jwe
parents:
diff changeset
23 #if !defined (octave_file_ops_h)
a51354c34bea [project @ 1996-01-23 03:33:34 by jwe]
jwe
parents:
diff changeset
24 #define octave_file_ops_h 1
a51354c34bea [project @ 1996-01-23 03:33:34 by jwe]
jwe
parents:
diff changeset
25
a51354c34bea [project @ 1996-01-23 03:33:34 by jwe]
jwe
parents:
diff changeset
26 #include <string>
a51354c34bea [project @ 1996-01-23 03:33:34 by jwe]
jwe
parents:
diff changeset
27
2283
cc9b29d0b43e [project @ 1996-05-27 17:40:57 by jwe]
jwe
parents: 2074
diff changeset
28 #ifdef HAVE_SYS_TYPES_H
cc9b29d0b43e [project @ 1996-05-27 17:40:57 by jwe]
jwe
parents: 2074
diff changeset
29 #include <sys/types.h>
cc9b29d0b43e [project @ 1996-05-27 17:40:57 by jwe]
jwe
parents: 2074
diff changeset
30 #endif
cc9b29d0b43e [project @ 1996-05-27 17:40:57 by jwe]
jwe
parents: 2074
diff changeset
31
3040
443851377f3f [project @ 1997-06-06 09:29:28 by jwe]
jwe
parents: 2937
diff changeset
32 #include "str-vec.h"
443851377f3f [project @ 1997-06-06 09:29:28 by jwe]
jwe
parents: 2937
diff changeset
33
2926
66ef74ee5d9f [project @ 1997-05-05 03:20:52 by jwe]
jwe
parents: 2847
diff changeset
34 struct
66ef74ee5d9f [project @ 1997-05-05 03:20:52 by jwe]
jwe
parents: 2847
diff changeset
35 file_ops
1765
a51354c34bea [project @ 1996-01-23 03:33:34 by jwe]
jwe
parents:
diff changeset
36 {
3504
5eef8a2294bd [project @ 2000-02-01 10:06:51 by jwe]
jwe
parents: 3040
diff changeset
37 static int mkdir (const std::string&, mode_t);
5eef8a2294bd [project @ 2000-02-01 10:06:51 by jwe]
jwe
parents: 3040
diff changeset
38 static int mkdir (const std::string&, mode_t, std::string&);
1765
a51354c34bea [project @ 1996-01-23 03:33:34 by jwe]
jwe
parents:
diff changeset
39
3504
5eef8a2294bd [project @ 2000-02-01 10:06:51 by jwe]
jwe
parents: 3040
diff changeset
40 static int mkfifo (const std::string&, mode_t);
5eef8a2294bd [project @ 2000-02-01 10:06:51 by jwe]
jwe
parents: 3040
diff changeset
41 static int mkfifo (const std::string&, mode_t, std::string&);
1765
a51354c34bea [project @ 1996-01-23 03:33:34 by jwe]
jwe
parents:
diff changeset
42
3710
9a77deefb8c9 [project @ 2000-08-02 20:47:44 by jwe]
jwe
parents: 3504
diff changeset
43 static int link (const std::string&, const std::string&);
9a77deefb8c9 [project @ 2000-08-02 20:47:44 by jwe]
jwe
parents: 3504
diff changeset
44 static int link (const std::string&, const std::string&, std::string&);
9a77deefb8c9 [project @ 2000-08-02 20:47:44 by jwe]
jwe
parents: 3504
diff changeset
45
9a77deefb8c9 [project @ 2000-08-02 20:47:44 by jwe]
jwe
parents: 3504
diff changeset
46 static int symlink (const std::string&, const std::string&);
9a77deefb8c9 [project @ 2000-08-02 20:47:44 by jwe]
jwe
parents: 3504
diff changeset
47 static int symlink (const std::string&, const std::string&, std::string&);
9a77deefb8c9 [project @ 2000-08-02 20:47:44 by jwe]
jwe
parents: 3504
diff changeset
48
9a77deefb8c9 [project @ 2000-08-02 20:47:44 by jwe]
jwe
parents: 3504
diff changeset
49 static int readlink (const std::string&, std::string&);
9a77deefb8c9 [project @ 2000-08-02 20:47:44 by jwe]
jwe
parents: 3504
diff changeset
50 static int readlink (const std::string&, std::string&, std::string&);
9a77deefb8c9 [project @ 2000-08-02 20:47:44 by jwe]
jwe
parents: 3504
diff changeset
51
3504
5eef8a2294bd [project @ 2000-02-01 10:06:51 by jwe]
jwe
parents: 3040
diff changeset
52 static int rename (const std::string&, const std::string&);
5eef8a2294bd [project @ 2000-02-01 10:06:51 by jwe]
jwe
parents: 3040
diff changeset
53 static int rename (const std::string&, const std::string&, std::string&);
1765
a51354c34bea [project @ 1996-01-23 03:33:34 by jwe]
jwe
parents:
diff changeset
54
3504
5eef8a2294bd [project @ 2000-02-01 10:06:51 by jwe]
jwe
parents: 3040
diff changeset
55 static int rmdir (const std::string&);
5eef8a2294bd [project @ 2000-02-01 10:06:51 by jwe]
jwe
parents: 3040
diff changeset
56 static int rmdir (const std::string&, std::string&);
1765
a51354c34bea [project @ 1996-01-23 03:33:34 by jwe]
jwe
parents:
diff changeset
57
5138
5fa9670b5956 [project @ 2005-02-09 23:13:03 by jwe]
jwe
parents: 4101
diff changeset
58 static std::string canonicalize_file_name (const std::string&);
5fa9670b5956 [project @ 2005-02-09 23:13:03 by jwe]
jwe
parents: 4101
diff changeset
59 static std::string canonicalize_file_name (const std::string&, std::string&);
5fa9670b5956 [project @ 2005-02-09 23:13:03 by jwe]
jwe
parents: 4101
diff changeset
60
3504
5eef8a2294bd [project @ 2000-02-01 10:06:51 by jwe]
jwe
parents: 3040
diff changeset
61 static std::string tempnam (const std::string&, const std::string&);
3710
9a77deefb8c9 [project @ 2000-08-02 20:47:44 by jwe]
jwe
parents: 3504
diff changeset
62 static std::string tempnam (const std::string&, const std::string&,
9a77deefb8c9 [project @ 2000-08-02 20:47:44 by jwe]
jwe
parents: 3504
diff changeset
63 std::string&);
1765
a51354c34bea [project @ 1996-01-23 03:33:34 by jwe]
jwe
parents:
diff changeset
64
3504
5eef8a2294bd [project @ 2000-02-01 10:06:51 by jwe]
jwe
parents: 3040
diff changeset
65 typedef std::string (*tilde_expansion_hook) (const std::string&);
3040
443851377f3f [project @ 1997-06-06 09:29:28 by jwe]
jwe
parents: 2937
diff changeset
66
443851377f3f [project @ 1997-06-06 09:29:28 by jwe]
jwe
parents: 2937
diff changeset
67 static tilde_expansion_hook tilde_expansion_preexpansion_hook;
443851377f3f [project @ 1997-06-06 09:29:28 by jwe]
jwe
parents: 2937
diff changeset
68
443851377f3f [project @ 1997-06-06 09:29:28 by jwe]
jwe
parents: 2937
diff changeset
69 static tilde_expansion_hook tilde_expansion_failure_hook;
443851377f3f [project @ 1997-06-06 09:29:28 by jwe]
jwe
parents: 2937
diff changeset
70
443851377f3f [project @ 1997-06-06 09:29:28 by jwe]
jwe
parents: 2937
diff changeset
71 static string_vector tilde_additional_prefixes;
443851377f3f [project @ 1997-06-06 09:29:28 by jwe]
jwe
parents: 2937
diff changeset
72
443851377f3f [project @ 1997-06-06 09:29:28 by jwe]
jwe
parents: 2937
diff changeset
73 static string_vector tilde_additional_suffixes;
443851377f3f [project @ 1997-06-06 09:29:28 by jwe]
jwe
parents: 2937
diff changeset
74
3504
5eef8a2294bd [project @ 2000-02-01 10:06:51 by jwe]
jwe
parents: 3040
diff changeset
75 static std::string tilde_expand (const std::string&);
2926
66ef74ee5d9f [project @ 1997-05-05 03:20:52 by jwe]
jwe
parents: 2847
diff changeset
76 static string_vector tilde_expand (const string_vector&);
1778
cb7512dadf2d [project @ 1996-01-24 05:20:38 by jwe]
jwe
parents: 1773
diff changeset
77
2926
66ef74ee5d9f [project @ 1997-05-05 03:20:52 by jwe]
jwe
parents: 2847
diff changeset
78 static int umask (mode_t);
2668
0d865ef7478f [project @ 1997-02-13 18:21:47 by jwe]
jwe
parents: 2283
diff changeset
79
3504
5eef8a2294bd [project @ 2000-02-01 10:06:51 by jwe]
jwe
parents: 3040
diff changeset
80 static int unlink (const std::string&);
5eef8a2294bd [project @ 2000-02-01 10:06:51 by jwe]
jwe
parents: 3040
diff changeset
81 static int unlink (const std::string&, std::string&);
4097
596f88296519 [project @ 2002-10-09 20:26:27 by jwe]
jwe
parents: 3710
diff changeset
82
596f88296519 [project @ 2002-10-09 20:26:27 by jwe]
jwe
parents: 3710
diff changeset
83 static bool is_dir_sep (char);
4101
ea537559ab07 [project @ 2002-10-11 20:57:21 by jwe]
jwe
parents: 4099
diff changeset
84
ea537559ab07 [project @ 2002-10-11 20:57:21 by jwe]
jwe
parents: 4099
diff changeset
85 static char dir_sep_char;
ea537559ab07 [project @ 2002-10-11 20:57:21 by jwe]
jwe
parents: 4099
diff changeset
86 static std::string dir_sep_str;
ea537559ab07 [project @ 2002-10-11 20:57:21 by jwe]
jwe
parents: 4099
diff changeset
87 static std::string dir_sep_chars;
2926
66ef74ee5d9f [project @ 1997-05-05 03:20:52 by jwe]
jwe
parents: 2847
diff changeset
88 };
1765
a51354c34bea [project @ 1996-01-23 03:33:34 by jwe]
jwe
parents:
diff changeset
89
a51354c34bea [project @ 1996-01-23 03:33:34 by jwe]
jwe
parents:
diff changeset
90 #endif
a51354c34bea [project @ 1996-01-23 03:33:34 by jwe]
jwe
parents:
diff changeset
91
a51354c34bea [project @ 1996-01-23 03:33:34 by jwe]
jwe
parents:
diff changeset
92 /*
a51354c34bea [project @ 1996-01-23 03:33:34 by jwe]
jwe
parents:
diff changeset
93 ;;; Local Variables: ***
a51354c34bea [project @ 1996-01-23 03:33:34 by jwe]
jwe
parents:
diff changeset
94 ;;; mode: C++ ***
a51354c34bea [project @ 1996-01-23 03:33:34 by jwe]
jwe
parents:
diff changeset
95 ;;; End: ***
a51354c34bea [project @ 1996-01-23 03:33:34 by jwe]
jwe
parents:
diff changeset
96 */