Displaying 4 results from an estimated 4 matches for "do_filesize".
2014 Jan 07
8
RFC: copy-attributes command
Hi,
attached there is a prototype of patch for adding a new copy-attributes
command. Such command would allow copy the attributes of a "file" to
another, so for example in guestfish:
copy-attributes foo bar permissions:true xattributes:false
would only copy the permissions of foo to bar, not copying its extended
attributes too.
Just few notes:
- my first daemon command, so
2014 Jan 13
0
[PATCH] New API: copy-attributes.
...b5f 100644
--- a/daemon/file.c
+++ b/daemon/file.c
@@ -28,6 +28,7 @@
#include "guestfs_protocol.h"
#include "daemon.h"
#include "actions.h"
+#include "optgroups.h"
GUESTFSD_EXT_CMD(str_file, file);
GUESTFSD_EXT_CMD(str_zcat, zcat);
@@ -584,3 +585,74 @@ do_filesize (const char *path)
return buf.st_size;
}
+
+int
+do_copy_attributes (const char *src, const char *dest, int all, int mode, int xattributes, int ownership)
+{
+ int r;
+ struct stat srcstat, deststat;
+
+ static const unsigned int file_mask = 07777;
+
+ /* If it was specified to copy every...
2014 Jan 07
0
Re: RFC: copy-attributes command
...ile.c
> @@ -28,6 +28,7 @@
> #include "guestfs_protocol.h"
> #include "daemon.h"
> #include "actions.h"
> +#include "optgroups.h"
>
> GUESTFSD_EXT_CMD(str_file, file);
> GUESTFSD_EXT_CMD(str_zcat, zcat);
> @@ -584,3 +585,46 @@ do_filesize (const char *path)
>
> return buf.st_size;
> }
> +
> +int
> +do_copy_attributes (const char *src, const char *dest, int permissions, int xattributes)
> +{
> + int r;
> + struct stat srcstat, deststat;
> +
> + CHROOT_IN;
> + r = stat (src, &srcstat);...
2014 Jan 10
4
Re: RFC: copy-attributes command
...s_protocol.h"
> > #include "daemon.h"
> > #include "actions.h"
> >
> > +#include "optgroups.h"
> >
> > GUESTFSD_EXT_CMD(str_file, file);
> > GUESTFSD_EXT_CMD(str_zcat, zcat);
> >
> > @@ -584,3 +585,46 @@ do_filesize (const char *path)
> >
> > return buf.st_size;
> >
> > }
> >
> > +
> > +int
> > +do_copy_attributes (const char *src, const char *dest, int
> > permissions, int xattributes) +{
> > + int r;
> > + struct stat srcstat, destst...