move set_nonblock, create_socket and path_exists to libi3
This commit is contained in:
committed by
Michael Stapelberg
parent
e4f12ac349
commit
131a6158c8
21
libi3/path_exists.c
Normal file
21
libi3/path_exists.c
Normal file
@ -0,0 +1,21 @@
|
||||
/*
|
||||
* 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);
|
||||
}
|
Reference in New Issue
Block a user