summaryrefslogtreecommitdiffstats
path: root/daemon/file.c
diff options
context:
space:
mode:
authorRichard Jones <rjones@redhat.com>2010-09-09 22:20:28 +0100
committerRichard Jones <rjones@redhat.com>2010-09-09 22:45:22 +0100
commit3a99114360636806078bbf614c241e89661bcc7f (patch)
tree8247c84a713c4c57144ae337ab52080810a29743 /daemon/file.c
parent55b6e18f95950b1a2ec69d549c9e6c8a5758d166 (diff)
downloadlibguestfs-3a99114360636806078bbf614c241e89661bcc7f.tar.gz
libguestfs-3a99114360636806078bbf614c241e89661bcc7f.tar.xz
libguestfs-3a99114360636806078bbf614c241e89661bcc7f.zip
daemon: Move 'exists', 'is-file' and 'is-dir' to separate file.
This commit is just code movement.
Diffstat (limited to 'daemon/file.c')
-rw-r--r--daemon/file.c34
1 files changed, 0 insertions, 34 deletions
diff --git a/daemon/file.c b/daemon/file.c
index da899b6c..476f4456 100644
--- a/daemon/file.c
+++ b/daemon/file.c
@@ -270,40 +270,6 @@ do_lchown (int owner, int group, const char *path)
}
int
-do_exists (const char *path)
-{
- int r;
-
- CHROOT_IN;
- r = access (path, F_OK);
- CHROOT_OUT;
-
- return r == 0;
-}
-
-int
-do_is_file (const char *path)
-{
- int r;
- struct stat buf;
-
- CHROOT_IN;
- r = lstat (path, &buf);
- CHROOT_OUT;
-
- if (r == -1) {
- if (errno != ENOENT && errno != ENOTDIR) {
- reply_with_perror ("stat: %s", path);
- return -1;
- }
- else
- return 0; /* Not a file. */
- }
-
- return S_ISREG (buf.st_mode);
-}
-
-int
do_write_file (const char *path, const char *content, int size)
{
int fd;