30 #ifndef _GLIBCXX_FS_OPS_H
31 #define _GLIBCXX_FS_OPS_H 1
33 #if __cplusplus >= 201703L
37 namespace std _GLIBCXX_VISIBILITY(default)
39 _GLIBCXX_BEGIN_NAMESPACE_VERSION
47 path absolute(
const path& __p);
48 path absolute(
const path& __p, error_code& __ec);
50 path canonical(
const path& __p);
51 path canonical(
const path& __p, error_code& __ec);
54 copy(
const path& __from,
const path& __to)
55 { copy(__from, __to, copy_options::none); }
58 copy(
const path& __from,
const path& __to, error_code& __ec)
59 { copy(__from, __to, copy_options::none, __ec); }
61 void copy(
const path& __from,
const path& __to,
copy_options __options);
62 void copy(
const path& __from,
const path& __to,
copy_options __options,
66 copy_file(
const path& __from,
const path& __to)
67 {
return copy_file(__from, __to, copy_options::none); }
70 copy_file(
const path& __from,
const path& __to, error_code& __ec)
71 {
return copy_file(__from, __to, copy_options::none, __ec); }
73 bool copy_file(
const path& __from,
const path& __to,
copy_options __option);
74 bool copy_file(
const path& __from,
const path& __to,
copy_options __option,
77 void copy_symlink(
const path& __existing_symlink,
const path& __new_symlink);
78 void copy_symlink(
const path& __existing_symlink,
const path& __new_symlink,
79 error_code& __ec) noexcept;
81 bool create_directories(
const path& __p);
82 bool create_directories(
const path& __p, error_code& __ec);
84 bool create_directory(
const path& __p);
85 bool create_directory(
const path& __p, error_code& __ec) noexcept;
87 bool create_directory(
const path& __p,
const path& attributes);
88 bool create_directory(
const path& __p,
const path& attributes,
89 error_code& __ec) noexcept;
91 void create_directory_symlink(
const path& __to,
const path& __new_symlink);
92 void create_directory_symlink(
const path& __to,
const path& __new_symlink,
93 error_code& __ec) noexcept;
95 void create_hard_link(
const path& __to,
const path& __new_hard_link);
96 void create_hard_link(
const path& __to,
const path& __new_hard_link,
97 error_code& __ec) noexcept;
99 void create_symlink(
const path& __to,
const path& __new_symlink);
100 void create_symlink(
const path& __to,
const path& __new_symlink,
101 error_code& __ec) noexcept;
104 path current_path(error_code& __ec);
105 void current_path(
const path& __p);
106 void current_path(
const path& __p, error_code& __ec) noexcept;
109 equivalent(
const path& __p1,
const path& __p2);
112 equivalent(
const path& __p1,
const path& __p2, error_code& __ec) noexcept;
115 exists(file_status __s) noexcept
116 {
return status_known(__s) && __s.type() != file_type::not_found; }
119 exists(
const path& __p)
120 {
return exists(status(__p)); }
123 exists(
const path& __p, error_code& __ec) noexcept
125 auto __s = status(__p, __ec);
126 if (status_known(__s))
129 return __s.type() != file_type::not_found;
134 uintmax_t file_size(
const path& __p);
135 uintmax_t file_size(
const path& __p, error_code& __ec) noexcept;
137 uintmax_t hard_link_count(
const path& __p);
138 uintmax_t hard_link_count(
const path& __p, error_code& __ec) noexcept;
141 is_block_file(file_status __s) noexcept
142 {
return __s.type() == file_type::block; }
145 is_block_file(
const path& __p)
146 {
return is_block_file(status(__p)); }
149 is_block_file(
const path& __p, error_code& __ec) noexcept
150 {
return is_block_file(status(__p, __ec)); }
153 is_character_file(file_status __s) noexcept
154 {
return __s.type() == file_type::character; }
157 is_character_file(
const path& __p)
158 {
return is_character_file(status(__p)); }
161 is_character_file(
const path& __p, error_code& __ec) noexcept
162 {
return is_character_file(status(__p, __ec)); }
165 is_directory(file_status __s) noexcept
166 {
return __s.type() == file_type::directory; }
169 is_directory(
const path& __p)
170 {
return is_directory(status(__p)); }
173 is_directory(
const path& __p, error_code& __ec) noexcept
174 {
return is_directory(status(__p, __ec)); }
176 bool is_empty(
const path& __p);
177 bool is_empty(
const path& __p, error_code& __ec);
180 is_fifo(file_status __s) noexcept
181 {
return __s.type() == file_type::fifo; }
184 is_fifo(
const path& __p)
185 {
return is_fifo(status(__p)); }
188 is_fifo(
const path& __p, error_code& __ec) noexcept
189 {
return is_fifo(status(__p, __ec)); }
192 is_other(file_status __s) noexcept
194 return exists(__s) && !is_regular_file(__s) && !is_directory(__s)
199 is_other(
const path& __p)
200 {
return is_other(status(__p)); }
203 is_other(
const path& __p, error_code& __ec) noexcept
204 {
return is_other(status(__p, __ec)); }
207 is_regular_file(file_status __s) noexcept
208 {
return __s.type() == file_type::regular; }
211 is_regular_file(
const path& __p)
212 {
return is_regular_file(status(__p)); }
215 is_regular_file(
const path& __p, error_code& __ec) noexcept
216 {
return is_regular_file(status(__p, __ec)); }
219 is_socket(file_status __s) noexcept
220 {
return __s.type() == file_type::socket; }
223 is_socket(
const path& __p)
224 {
return is_socket(status(__p)); }
227 is_socket(
const path& __p, error_code& __ec) noexcept
228 {
return is_socket(status(__p, __ec)); }
231 is_symlink(file_status __s) noexcept
232 {
return __s.type() == file_type::symlink; }
235 is_symlink(
const path& __p)
236 {
return is_symlink(symlink_status(__p)); }
239 is_symlink(
const path& __p, error_code& __ec) noexcept
240 {
return is_symlink(symlink_status(__p, __ec)); }
242 file_time_type last_write_time(
const path& __p);
243 file_time_type last_write_time(
const path& __p, error_code& __ec) noexcept;
244 void last_write_time(
const path& __p, file_time_type __new_time);
245 void last_write_time(
const path& __p, file_time_type __new_time,
246 error_code& __ec) noexcept;
249 permissions(
const path& __p,
perms __prms,
250 perm_options __opts = perm_options::replace);
253 permissions(
const path& __p,
perms __prms, error_code& __ec) noexcept
254 { permissions(__p, __prms, perm_options::replace, __ec); }
257 permissions(
const path& __p,
perms __prms, perm_options __opts,
258 error_code& __ec) noexcept;
260 inline path proximate(
const path& __p, error_code& __ec)
261 {
return proximate(__p, current_path(), __ec); }
263 path proximate(
const path& __p,
const path&
__base = current_path());
264 path proximate(
const path& __p,
const path&
__base, error_code& __ec);
266 path read_symlink(
const path& __p);
267 path read_symlink(
const path& __p, error_code& __ec);
269 inline path relative(
const path& __p, error_code& __ec)
270 {
return relative(__p, current_path(), __ec); }
272 path relative(
const path& __p,
const path&
__base = current_path());
273 path relative(
const path& __p,
const path&
__base, error_code& __ec);
275 bool remove(
const path& __p);
276 bool remove(
const path& __p, error_code& __ec) noexcept;
278 uintmax_t remove_all(
const path& __p);
279 uintmax_t remove_all(
const path& __p, error_code& __ec);
281 void rename(
const path& __from,
const path& __to);
282 void rename(
const path& __from,
const path& __to, error_code& __ec) noexcept;
284 void resize_file(
const path& __p, uintmax_t __size);
285 void resize_file(
const path& __p, uintmax_t __size, error_code& __ec) noexcept;
287 space_info space(
const path& __p);
288 space_info space(
const path& __p, error_code& __ec) noexcept;
290 file_status status(
const path& __p);
291 file_status status(
const path& __p, error_code& __ec) noexcept;
293 inline bool status_known(file_status __s) noexcept
294 {
return __s.type() != file_type::none; }
296 file_status symlink_status(
const path& __p);
297 file_status symlink_status(
const path& __p, error_code& __ec) noexcept;
299 path temp_directory_path();
300 path temp_directory_path(error_code& __ec);
302 path weakly_canonical(
const path& __p);
303 path weakly_canonical(
const path& __p, error_code& __ec);
308 _GLIBCXX_END_NAMESPACE_VERSION
copy_options
Bitmask type.
ISO C++ entities toplevel namespace is std.
constexpr _Iterator __base(_Iterator __it)