1
/* Copyright (c) 2008, 2010, Oracle and/or its affiliates. All rights reserved.
3
This program is free software; you can redistribute it and/or modify
4
it under the terms of the GNU General Public License as published by
5
the Free Software Foundation; version 2 of the License.
7
This program is distributed in the hope that it will be useful,
8
but WITHOUT ANY WARRANTY; without even the implied warranty of
9
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10
GNU General Public License for more details.
12
You should have received a copy of the GNU General Public License
13
along with this program; if not, write to the Free Software
14
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA */
20
#ifndef mode_t /* MySQL 5.5+ defines mode_t */
28
class DirIteratorImpl& m_impl;
29
Iterator(const Iterator&); // not impl
30
Iterator& operator=(const Iterator&); // not impl
35
int open(const char* path);
39
Return the next regular file or NULL if no more file found
41
const char* next_file(void);
44
Return the next entry(file, dir, symlink etc.) or NULL if no
47
const char* next_entry(void);
52
Temp(const Temp&); // not impl
53
Temp& operator=(const Temp&); // not impl
57
const char* path(void) const;
60
static mode_t u_r(void);
61
static mode_t u_w(void);
62
static mode_t u_x(void);
63
static mode_t u_rwx(void) { return (u_r() | u_w() | u_x()); }
65
static mode_t g_r(void);
66
static mode_t g_w(void);
67
static mode_t g_x(void);
68
static mode_t g_rwx(void) { return (g_r() | g_w() | g_x()); }
70
static mode_t o_r(void);
71
static mode_t o_w(void);
72
static mode_t o_x(void);
73
static mode_t o_rwx(void) { return (o_r() | o_w() | o_x()); }
77
path - path to directory to create
78
mode - mode for the directory to create
79
ignore_existing - don't print or return error if directory
82
static bool create(const char *path,
83
mode_t mode = u_rwx(),
84
bool ignore_existing = false);
87
Remove directory recursively
88
path - path to directory that should be removed
89
only_contents - only remove the contents of the directory
92
static bool remove_recursive(const char* path, bool only_contents = false);
95
Remove empty directory
97
static bool remove(const char* path);
100
Change working directory
102
static int chdir(const char* path);