Lines Matching refs:path
63 #include "path-util.h"
243 int unlink_noerrno(const char *path) {
247 r = unlink(path);
461 int rmdir_parents(const char *path, const char *stop) {
465 assert(path);
468 l = strlen(path);
471 while (l > 0 && path[l-1] == '/')
478 while (l > 0 && path[l-1] != '/')
482 while (l > 0 && path[l-1] == '/')
488 if (!(t = strndup(path, l)))
945 char* dirname_malloc(const char *path) {
948 d = strdup(path);
970 int chmod_and_chown(const char *path, mode_t mode, uid_t uid, gid_t gid) {
971 assert(path);
978 if (chmod(path, mode) < 0)
982 if (chown(path, uid, gid) < 0)
988 int touch_file(const char *path, bool parents, usec_t stamp, uid_t uid, gid_t gid, mode_t mode) {
992 assert(path);
995 mkdir_parents(path, 0755);
997 fd = open(path, O_WRONLY|O_CREAT|O_CLOEXEC|O_NOCTTY, mode > 0 ? mode : 0644);
1027 int touch(const char *path) {
1028 return touch_file(path, false, USEC_INFINITY, UID_INVALID, GID_INVALID, 0);
1120 /* Fallback path when ppoll() is unavailable */
1132 int fopen_temporary(const char *path, FILE **_f, char **_temp_path) {
1137 assert(path);
1141 r = tempfn_xxxxxx(path, &t);
1742 int is_dir(const char* path, bool follow) {
1747 r = stat(path, &st);
1749 r = lstat(path, &st);