30 #ifndef _GLIBCXX_EXPERIMENTAL_FS_OPS_H 31 #define _GLIBCXX_EXPERIMENTAL_FS_OPS_H 1 33 #if __cplusplus < 201103L 39 namespace std _GLIBCXX_VISIBILITY(default)
41 _GLIBCXX_BEGIN_NAMESPACE_VERSION
43 namespace experimental
54 path absolute(
const path& __p,
const path& __base = current_path());
56 path canonical(
const path& __p,
const path& __base = current_path());
57 path canonical(
const path& __p, error_code& __ec);
58 path canonical(
const path& __p,
const path& __base, error_code& __ec);
61 copy(
const path& __from,
const path& __to)
62 { copy(__from, __to, copy_options::none); }
65 copy(
const path& __from,
const path& __to, error_code& __ec) noexcept
66 { copy(__from, __to, copy_options::none, __ec); }
68 void copy(
const path& __from,
const path& __to,
copy_options __options);
69 void copy(
const path& __from,
const path& __to,
copy_options __options,
70 error_code& __ec) noexcept;
73 copy_file(
const path& __from,
const path& __to)
74 {
return copy_file(__from, __to, copy_options::none); }
77 copy_file(
const path& __from,
const path& __to, error_code& __ec) noexcept
78 {
return copy_file(__from, __to, copy_options::none, __ec); }
80 bool copy_file(
const path& __from,
const path& __to,
copy_options __option);
81 bool copy_file(
const path& __from,
const path& __to,
copy_options __option,
82 error_code& __ec) noexcept;
84 void copy_symlink(
const path& __existing_symlink,
const path& __new_symlink);
85 void copy_symlink(
const path& __existing_symlink,
const path& __new_symlink,
86 error_code& __ec) noexcept;
88 bool create_directories(
const path& __p);
89 bool create_directories(
const path& __p, error_code& __ec) noexcept;
91 bool create_directory(
const path& __p);
92 bool create_directory(
const path& __p, error_code& __ec) noexcept;
94 bool create_directory(
const path& __p,
const path& attributes);
95 bool create_directory(
const path& __p,
const path& attributes,
96 error_code& __ec) noexcept;
98 void create_directory_symlink(
const path& __to,
const path& __new_symlink);
99 void create_directory_symlink(
const path& __to,
const path& __new_symlink,
100 error_code& __ec) noexcept;
102 void create_hard_link(
const path& __to,
const path& __new_hard_link);
103 void create_hard_link(
const path& __to,
const path& __new_hard_link,
104 error_code& __ec) noexcept;
106 void create_symlink(
const path& __to,
const path& __new_symlink);
107 void create_symlink(
const path& __to,
const path& __new_symlink,
108 error_code& __ec) noexcept;
111 path current_path(error_code& __ec);
112 void current_path(
const path& __p);
113 void current_path(
const path& __p, error_code& __ec) noexcept;
116 equivalent(
const path& __p1,
const path& __p2);
119 equivalent(
const path& __p1,
const path& __p2, error_code& __ec) noexcept;
122 exists(file_status __s) noexcept
123 {
return status_known(__s) && __s.type() != file_type::not_found; }
126 exists(
const path& __p)
127 {
return exists(status(__p)); }
130 exists(
const path& __p, error_code& __ec) noexcept
132 auto __s = status(__p, __ec);
133 if (status_known(__s))
136 return __s.type() != file_type::not_found;
141 uintmax_t file_size(
const path& __p);
142 uintmax_t file_size(
const path& __p, error_code& __ec) noexcept;
144 uintmax_t hard_link_count(
const path& __p);
145 uintmax_t hard_link_count(
const path& __p, error_code& __ec) noexcept;
148 is_block_file(file_status __s) noexcept
149 {
return __s.type() == file_type::block; }
152 is_block_file(
const path& __p)
153 {
return is_block_file(status(__p)); }
156 is_block_file(
const path& __p, error_code& __ec) noexcept
157 {
return is_block_file(status(__p, __ec)); }
160 is_character_file(file_status __s) noexcept
161 {
return __s.type() == file_type::character; }
164 is_character_file(
const path& __p)
165 {
return is_character_file(status(__p)); }
168 is_character_file(
const path& __p, error_code& __ec) noexcept
169 {
return is_character_file(status(__p, __ec)); }
172 is_directory(file_status __s) noexcept
173 {
return __s.type() == file_type::directory; }
176 is_directory(
const path& __p)
177 {
return is_directory(status(__p)); }
180 is_directory(
const path& __p, error_code& __ec) noexcept
181 {
return is_directory(status(__p, __ec)); }
183 bool is_empty(
const path& __p);
184 bool is_empty(
const path& __p, error_code& __ec) noexcept;
187 is_fifo(file_status __s) noexcept
188 {
return __s.type() == file_type::fifo; }
191 is_fifo(
const path& __p)
192 {
return is_fifo(status(__p)); }
195 is_fifo(
const path& __p, error_code& __ec) noexcept
196 {
return is_fifo(status(__p, __ec)); }
199 is_other(file_status __s) noexcept
201 return exists(__s) && !is_regular_file(__s) && !is_directory(__s)
206 is_other(
const path& __p)
207 {
return is_other(status(__p)); }
210 is_other(
const path& __p, error_code& __ec) noexcept
211 {
return is_other(status(__p, __ec)); }
214 is_regular_file(file_status __s) noexcept
215 {
return __s.type() == file_type::regular; }
218 is_regular_file(
const path& __p)
219 {
return is_regular_file(status(__p)); }
222 is_regular_file(
const path& __p, error_code& __ec) noexcept
223 {
return is_regular_file(status(__p, __ec)); }
226 is_socket(file_status __s) noexcept
227 {
return __s.type() == file_type::socket; }
230 is_socket(
const path& __p)
231 {
return is_socket(status(__p)); }
234 is_socket(
const path& __p, error_code& __ec) noexcept
235 {
return is_socket(status(__p, __ec)); }
238 is_symlink(file_status __s) noexcept
239 {
return __s.type() == file_type::symlink; }
242 is_symlink(
const path& __p)
243 {
return is_symlink(symlink_status(__p)); }
246 is_symlink(
const path& __p, error_code& __ec) noexcept
247 {
return is_symlink(symlink_status(__p, __ec)); }
249 file_time_type last_write_time(
const path& __p);
250 file_time_type last_write_time(
const path& __p, error_code& __ec) noexcept;
251 void last_write_time(
const path& __p, file_time_type __new_time);
252 void last_write_time(
const path& __p, file_time_type __new_time,
253 error_code& __ec) noexcept;
255 void permissions(
const path& __p,
perms __prms);
256 void permissions(
const path& __p,
perms __prms, error_code& __ec) noexcept;
258 path read_symlink(
const path& __p);
259 path read_symlink(
const path& __p, error_code& __ec);
261 bool remove(
const path& __p);
262 bool remove(
const path& __p, error_code& __ec) noexcept;
264 uintmax_t remove_all(
const path& __p);
265 uintmax_t remove_all(
const path& __p, error_code& __ec) noexcept;
267 void rename(
const path& __from,
const path& __to);
268 void rename(
const path& __from,
const path& __to, error_code& __ec) noexcept;
270 void resize_file(
const path& __p, uintmax_t __size);
271 void resize_file(
const path& __p, uintmax_t __size, error_code& __ec) noexcept;
273 space_info space(
const path& __p);
274 space_info space(
const path& __p, error_code& __ec) noexcept;
276 file_status status(
const path& __p);
277 file_status status(
const path& __p, error_code& __ec) noexcept;
279 inline bool status_known(file_status __s) noexcept
280 {
return __s.type() != file_type::none; }
282 file_status symlink_status(
const path& __p);
283 file_status symlink_status(
const path& __p, error_code& __ec) noexcept;
285 path system_complete(
const path& __p);
286 path system_complete(
const path& __p, error_code& __ec);
288 path temp_directory_path();
289 path temp_directory_path(error_code& __ec);
296 _GLIBCXX_END_NAMESPACE_VERSION
301 #endif // _GLIBCXX_EXPERIMENTAL_FS_OPS_H
copy_options
Bitmask type.
ISO C++ entities toplevel namespace is std.