Codebase list i3-gaps / 277d436 libi3 / path_exists.c
277d436

Tree @277d436 (Download .tar.gz)

path_exists.c @277d436raw · history · blame

/*
 * vim:ts=4:sw=4:expandtab
 *
 * i3 - an improved dynamic tiling window manager
 * © 2009 Michael Stapelberg and contributors (see also: LICENSE)
 *
 */
#include "libi3.h"

#include <sys/types.h>
#include <sys/stat.h>
#include <unistd.h>

/*
 * Checks if the given path exists by calling stat().
 *
 */
bool path_exists(const char *path) {
    struct stat buf;
    return (stat(path, &buf) == 0);
}