edelib: edelib/FileTest.h Source File

edelib 1.0

- Main Page
- Related Pages
- Modules
- Namespaces
- Classes
- Files

- File List

FileTest.h
1 /*
2 * $Id: FileTest.h 2839 2009-09-28 11:36:20Z karijes $
3 *
4 * File info facility
5 * Copyright (c) 2009 edelib authors
6 *
7 * This library is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU Lesser General Public
9 * License as published by the Free Software Foundation; either
10 * version 2 of the License, or (at your option) any later version.
11 *
12 * This library is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 * Lesser General Public License for more details.
16 *
17 * You should have received a copy of the GNU Lesser General Public License
18 * along with this library. If not, see <http://www.gnu.org/licenses/>.
19 */
20
21 #ifndef __EDELIB_FILETEST_H__
22 #define __EDELIB_FILETEST_H__
23
24 #include "edelib-global.h"
25
26 EDELIB_NS_BEGIN
27
32 typedef enum {
33 FILE_TEST_IS_REGULAR = 1 << 0,
34 FILE_TEST_IS_DIR = 1 << 1,
35 FILE_TEST_IS_SYMLINK = 1 << 2,
36 FILE_TEST_IS_CHAR = 1 << 3,
37 FILE_TEST_IS_BLOCK = 1 << 4,
38 FILE_TEST_IS_FIFO = 1 << 5,
39 FILE_TEST_IS_SOCKET = 1 << 6,
40 FILE_TEST_IS_READABLE = 1 << 7,
41 FILE_TEST_IS_WRITEABLE = 1 << 8,
42 FILE_TEST_IS_EXECUTABLE = 1 << 9,
43 FILE_TEST_EXISTS = 1 << 10
44 } FileTestFlags;
45
60 EDELIB_API bool file_test(const char* path, unsigned int flags);
61
62 EDELIB_NS_END
63 #endif
edelib::FILE_TEST_IS_CHAR
character device
Definition: FileTest.h:36
edelib::FILE_TEST_EXISTS
exists, no matter what type
Definition: FileTest.h:43
edelib::FILE_TEST_IS_BLOCK
block device
Definition: FileTest.h:37
edelib::FILE_TEST_IS_EXECUTABLE
executable
Definition: FileTest.h:42
edelib::FILE_TEST_IS_WRITEABLE
writeable
Definition: FileTest.h:41
edelib::FILE_TEST_IS_READABLE
readable
Definition: FileTest.h:40
edelib::FILE_TEST_IS_FIFO
FIFO (pipes)
Definition: FileTest.h:38
edelib::FILE_TEST_IS_SYMLINK
symbolic link
Definition: FileTest.h:35
edelib::FileTestFlags
FileTestFlags
Available flags for file_test()
Definition: FileTest.h:32
edelib::FILE_TEST_IS_DIR
directory
Definition: FileTest.h:34
edelib::FILE_TEST_IS_REGULAR
file
Definition: FileTest.h:33
edelib::FILE_TEST_IS_SOCKET
socket
Definition: FileTest.h:39
edelib::file_test
bool file_test(const char *path, unsigned int flags)