coreutils/src/libfileis.h

63 lines
2.0 KiB
C

/*
* Copyright (c) 2023 DTB <trinity@trinity.moe>
* SPDX-License-Identifier: AGPL-3.0-or-later
*
* This program is free software: you can redistribute it and/or modify it under
* the terms of the GNU Affero General Public License as published by the Free
* Software Foundation, either version 3 of the License, or (at your option) any
* later version.
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
* FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more
* details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see https://www.gnu.org/licenses/.
*/
/* libfileis functions return true if the condition is true and false if the
* condition is false. Returned values are 0 or 1 only. */
/* True if file exists and is a block special file. */
int f_blockspecial(char *path);
/* True if file exists and is a character special file. */
int f_charspecial(char *path);
/* True if file exists and is a directory. */
int f_directory(char *path);
/* True if file exists and is executable. */
int f_executable(char *path);
/* True if file exists (regardless of type). */
int f_exists(char *path);
/* True if file exists and is a named pipe (FIFO). */
int f_fifospecial(char *path);
/* True if file exists and its set group ID flag is set. */
int f_gid(char *path);
/* True if file exists and is readable. */
int f_readable(char *path);
/* True if file exists and is a regular file. */
int f_regular(char *path);
/* True if file exists and is a socket. */
int f_socket(char *path);
/* True if file exists and its sticky bit is set. */
int f_sticky(char *path);
/* True if file exists and is a symbolic link. */
int f_symlink(char *path);
/* True if file exists and its set user ID flag is set. */
int f_uid(char *path);
/* True if file exists and is writeable. */
int f_writeable(char *path);