annotate liboctave/file-ops.h @ 6469:a848b846cb3a ss-2-9-10

[project @ 2007-03-27 18:42:11 by jwe]
author jwe
date Tue, 27 Mar 2007 18:42:11 +0000
parents 143b556ce725
children 93c65f2a5668
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
5307
4c8a2e4e0717 [project @ 2005-04-26 19:24:27 by jwe]
jwe
parents: 5138
diff changeset
19 Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
4c8a2e4e0717 [project @ 2005-04-26 19:24:27 by jwe]
jwe
parents: 5138
diff changeset
20 02110-1301, USA.
1765
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
a51354c34bea [project @ 1996-01-23 03:33:34 by jwe]
jwe
parents:
diff changeset
24 #if !defined (octave_file_ops_h)
a51354c34bea [project @ 1996-01-23 03:33:34 by jwe]
jwe
parents:
diff changeset
25 #define octave_file_ops_h 1
a51354c34bea [project @ 1996-01-23 03:33:34 by jwe]
jwe
parents:
diff changeset
26
a51354c34bea [project @ 1996-01-23 03:33:34 by jwe]
jwe
parents:
diff changeset
27 #include <string>
a51354c34bea [project @ 1996-01-23 03:33:34 by jwe]
jwe
parents:
diff changeset
28
2283
cc9b29d0b43e [project @ 1996-05-27 17:40:57 by jwe]
jwe
parents: 2074
diff changeset
29 #ifdef HAVE_SYS_TYPES_H
cc9b29d0b43e [project @ 1996-05-27 17:40:57 by jwe]
jwe
parents: 2074
diff changeset
30 #include <sys/types.h>
cc9b29d0b43e [project @ 1996-05-27 17:40:57 by jwe]
jwe
parents: 2074
diff changeset
31 #endif
cc9b29d0b43e [project @ 1996-05-27 17:40:57 by jwe]
jwe
parents: 2074
diff changeset
32
3040
443851377f3f [project @ 1997-06-06 09:29:28 by jwe]
jwe
parents: 2937
diff changeset
33 #include "str-vec.h"
443851377f3f [project @ 1997-06-06 09:29:28 by jwe]
jwe
parents: 2937
diff changeset
34
2926
66ef74ee5d9f [project @ 1997-05-05 03:20:52 by jwe]
jwe
parents: 2847
diff changeset
35 struct
6108
143b556ce725 [project @ 2006-10-27 01:45:54 by jwe]
jwe
parents: 5476
diff changeset
36 OCTAVE_API
2926
66ef74ee5d9f [project @ 1997-05-05 03:20:52 by jwe]
jwe
parents: 2847
diff changeset
37 file_ops
1765
a51354c34bea [project @ 1996-01-23 03:33:34 by jwe]
jwe
parents:
diff changeset
38 {
3504
5eef8a2294bd [project @ 2000-02-01 10:06:51 by jwe]
jwe
parents: 3040
diff changeset
39 static int mkdir (const std::string&, mode_t);
5eef8a2294bd [project @ 2000-02-01 10:06:51 by jwe]
jwe
parents: 3040
diff changeset
40 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
41
3504
5eef8a2294bd [project @ 2000-02-01 10:06:51 by jwe]
jwe
parents: 3040
diff changeset
42 static int mkfifo (const std::string&, mode_t);
5eef8a2294bd [project @ 2000-02-01 10:06:51 by jwe]
jwe
parents: 3040
diff changeset
43 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
44
3710
9a77deefb8c9 [project @ 2000-08-02 20:47:44 by jwe]
jwe
parents: 3504
diff changeset
45 static int link (const std::string&, const std::string&);
9a77deefb8c9 [project @ 2000-08-02 20:47:44 by jwe]
jwe
parents: 3504
diff changeset
46 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
47
9a77deefb8c9 [project @ 2000-08-02 20:47:44 by jwe]
jwe
parents: 3504
diff changeset
48 static int symlink (const std::string&, const std::string&);
9a77deefb8c9 [project @ 2000-08-02 20:47:44 by jwe]
jwe
parents: 3504
diff changeset
49 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
50
9a77deefb8c9 [project @ 2000-08-02 20:47:44 by jwe]
jwe
parents: 3504
diff changeset
51 static int readlink (const std::string&, std::string&);
9a77deefb8c9 [project @ 2000-08-02 20:47:44 by jwe]
jwe
parents: 3504
diff changeset
52 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
53
3504
5eef8a2294bd [project @ 2000-02-01 10:06:51 by jwe]
jwe
parents: 3040
diff changeset
54 static int rename (const std::string&, const std::string&);
5eef8a2294bd [project @ 2000-02-01 10:06:51 by jwe]
jwe
parents: 3040
diff changeset
55 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
56
3504
5eef8a2294bd [project @ 2000-02-01 10:06:51 by jwe]
jwe
parents: 3040
diff changeset
57 static int rmdir (const std::string&);
5eef8a2294bd [project @ 2000-02-01 10:06:51 by jwe]
jwe
parents: 3040
diff changeset
58 static int rmdir (const std::string&, std::string&);
1765
a51354c34bea [project @ 1996-01-23 03:33:34 by jwe]
jwe
parents:
diff changeset
59
5476
941f0fc6b596 [project @ 2005-09-29 22:46:07 by jwe]
jwe
parents: 5307
diff changeset
60 static int recursive_rmdir (const std::string&);
941f0fc6b596 [project @ 2005-09-29 22:46:07 by jwe]
jwe
parents: 5307
diff changeset
61 static int recursive_rmdir (const std::string&, std::string&);
941f0fc6b596 [project @ 2005-09-29 22:46:07 by jwe]
jwe
parents: 5307
diff changeset
62
5138
5fa9670b5956 [project @ 2005-02-09 23:13:03 by jwe]
jwe
parents: 4101
diff changeset
63 static std::string canonicalize_file_name (const std::string&);
5fa9670b5956 [project @ 2005-02-09 23:13:03 by jwe]
jwe
parents: 4101
diff changeset
64 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
65
3504
5eef8a2294bd [project @ 2000-02-01 10:06:51 by jwe]
jwe
parents: 3040
diff changeset
66 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
67 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
68 std::string&);
1765
a51354c34bea [project @ 1996-01-23 03:33:34 by jwe]
jwe
parents:
diff changeset
69
3504
5eef8a2294bd [project @ 2000-02-01 10:06:51 by jwe]
jwe
parents: 3040
diff changeset
70 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
71
443851377f3f [project @ 1997-06-06 09:29:28 by jwe]
jwe
parents: 2937
diff changeset
72 static tilde_expansion_hook tilde_expansion_preexpansion_hook;
443851377f3f [project @ 1997-06-06 09:29:28 by jwe]
jwe
parents: 2937
diff changeset
73
443851377f3f [project @ 1997-06-06 09:29:28 by jwe]
jwe
parents: 2937
diff changeset
74 static tilde_expansion_hook tilde_expansion_failure_hook;
443851377f3f [project @ 1997-06-06 09:29:28 by jwe]
jwe
parents: 2937
diff changeset
75
443851377f3f [project @ 1997-06-06 09:29:28 by jwe]
jwe
parents: 2937
diff changeset
76 static string_vector tilde_additional_prefixes;
443851377f3f [project @ 1997-06-06 09:29:28 by jwe]
jwe
parents: 2937
diff changeset
77
443851377f3f [project @ 1997-06-06 09:29:28 by jwe]
jwe
parents: 2937
diff changeset
78 static string_vector tilde_additional_suffixes;
443851377f3f [project @ 1997-06-06 09:29:28 by jwe]
jwe
parents: 2937
diff changeset
79
3504
5eef8a2294bd [project @ 2000-02-01 10:06:51 by jwe]
jwe
parents: 3040
diff changeset
80 static std::string tilde_expand (const std::string&);
2926
66ef74ee5d9f [project @ 1997-05-05 03:20:52 by jwe]
jwe
parents: 2847
diff changeset
81 static string_vector tilde_expand (const string_vector&);
1778
cb7512dadf2d [project @ 1996-01-24 05:20:38 by jwe]
jwe
parents: 1773
diff changeset
82
2926
66ef74ee5d9f [project @ 1997-05-05 03:20:52 by jwe]
jwe
parents: 2847
diff changeset
83 static int umask (mode_t);
2668
0d865ef7478f [project @ 1997-02-13 18:21:47 by jwe]
jwe
parents: 2283
diff changeset
84
3504
5eef8a2294bd [project @ 2000-02-01 10:06:51 by jwe]
jwe
parents: 3040
diff changeset
85 static int unlink (const std::string&);
5eef8a2294bd [project @ 2000-02-01 10:06:51 by jwe]
jwe
parents: 3040
diff changeset
86 static int unlink (const std::string&, std::string&);
4097
596f88296519 [project @ 2002-10-09 20:26:27 by jwe]
jwe
parents: 3710
diff changeset
87
596f88296519 [project @ 2002-10-09 20:26:27 by jwe]
jwe
parents: 3710
diff changeset
88 static bool is_dir_sep (char);
4101
ea537559ab07 [project @ 2002-10-11 20:57:21 by jwe]
jwe
parents: 4099
diff changeset
89
ea537559ab07 [project @ 2002-10-11 20:57:21 by jwe]
jwe
parents: 4099
diff changeset
90 static char dir_sep_char;
ea537559ab07 [project @ 2002-10-11 20:57:21 by jwe]
jwe
parents: 4099
diff changeset
91 static std::string dir_sep_str;
ea537559ab07 [project @ 2002-10-11 20:57:21 by jwe]
jwe
parents: 4099
diff changeset
92 static std::string dir_sep_chars;
2926
66ef74ee5d9f [project @ 1997-05-05 03:20:52 by jwe]
jwe
parents: 2847
diff changeset
93 };
1765
a51354c34bea [project @ 1996-01-23 03:33:34 by jwe]
jwe
parents:
diff changeset
94
a51354c34bea [project @ 1996-01-23 03:33:34 by jwe]
jwe
parents:
diff changeset
95 #endif
a51354c34bea [project @ 1996-01-23 03:33:34 by jwe]
jwe
parents:
diff changeset
96
a51354c34bea [project @ 1996-01-23 03:33:34 by jwe]
jwe
parents:
diff changeset
97 /*
a51354c34bea [project @ 1996-01-23 03:33:34 by jwe]
jwe
parents:
diff changeset
98 ;;; Local Variables: ***
a51354c34bea [project @ 1996-01-23 03:33:34 by jwe]
jwe
parents:
diff changeset
99 ;;; mode: C++ ***
a51354c34bea [project @ 1996-01-23 03:33:34 by jwe]
jwe
parents:
diff changeset
100 ;;; End: ***
a51354c34bea [project @ 1996-01-23 03:33:34 by jwe]
jwe
parents:
diff changeset
101 */