File: path_exists.c

package info (click to toggle)
i3-wm 4.25-3
  • links: PTS, VCS
  • area: main
  • in suites: forky
  • size: 7,712 kB
  • sloc: ansic: 30,153; perl: 19,229; sh: 70; makefile: 9
file content (21 lines) | stat: -rw-r--r-- 395 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
/*
 * vim:ts=4:sw=4:expandtab
 *
 * i3 - an improved 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);
}